code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
|---|---|---|
@Nonnull
public static FileIOError copyDirRecursive (@Nonnull final File aSourceDir, @Nonnull final File aTargetDir)
{
ValueEnforcer.notNull (aSourceDir, "SourceDirectory");
ValueEnforcer.notNull (aTargetDir, "TargetDirectory");
// Does the source directory exist?
if (!FileHelper.existsDir (aSourceDir))
return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.COPY_DIR_RECURSIVE, aSourceDir);
// Are source and target different?
if (EqualsHelper.equals (aSourceDir, aTargetDir))
return EFileIOErrorCode.SOURCE_EQUALS_TARGET.getAsIOError (EFileIOOperation.COPY_DIR_RECURSIVE, aSourceDir);
// Is the source a parent of target?
if (FileHelper.isParentDirectory (aSourceDir, aTargetDir))
return EFileIOErrorCode.TARGET_IS_CHILD_OF_SOURCE.getAsIOError (EFileIOOperation.COPY_DIR_RECURSIVE,
aSourceDir,
aTargetDir);
// Does the target directory already exist?
if (aTargetDir.exists ())
return EFileIOErrorCode.TARGET_ALREADY_EXISTS.getAsIOError (EFileIOOperation.COPY_DIR_RECURSIVE, aTargetDir);
// Is the source directory readable?
if (!aSourceDir.canRead ())
return EFileIOErrorCode.SOURCE_NOT_READABLE.getAsIOError (EFileIOOperation.COPY_DIR_RECURSIVE, aSourceDir);
// Is the target parent directory writable?
final File aTargetParentDir = aTargetDir.getParentFile ();
if (aTargetParentDir != null && aTargetParentDir.exists () && !aTargetParentDir.canWrite ())
return EFileIOErrorCode.TARGET_PARENT_NOT_WRITABLE.getAsIOError (EFileIOOperation.COPY_DIR_RECURSIVE, aTargetDir);
FileIOError eCode;
// Ensure the targets parent directory is present
eCode = createDirRecursive (aTargetDir);
if (eCode.isFailure ())
return eCode;
for (final File aChild : FileHelper.getDirectoryContent (aSourceDir))
{
if (aChild.isDirectory ())
{
// Skip "." and ".."
if (FilenameHelper.isSystemInternalDirectory (aChild.getName ()))
continue;
// Copy directory
eCode = copyDirRecursive (aChild, new File (aTargetDir, aChild.getName ()));
if (eCode.isFailure ())
return eCode;
}
else
if (aChild.isFile ())
{
// Copy a file
eCode = copyFile (aChild, new File (aTargetDir, aChild.getName ()));
if (eCode.isFailure ())
return eCode;
}
else
{
// Neither directory not file - don't know how to handle
return EFileIOErrorCode.OBJECT_CANNOT_BE_HANDLED.getAsIOError (EFileIOOperation.COPY_DIR_RECURSIVE, aChild);
}
}
// Done
return EFileIOErrorCode.NO_ERROR.getAsIOError (EFileIOOperation.COPY_DIR_RECURSIVE, aSourceDir, aTargetDir);
}
|
class class_name[name] begin[{]
method[copyDirRecursive, return_type[type[FileIOError]], modifier[public static], parameter[aSourceDir, aTargetDir]] begin[{]
call[ValueEnforcer.notNull, parameter[member[.aSourceDir], literal["SourceDirectory"]]]
call[ValueEnforcer.notNull, parameter[member[.aTargetDir], literal["TargetDirectory"]]]
if[call[FileHelper.existsDir, parameter[member[.aSourceDir]]]] begin[{]
return[call[EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError, parameter[member[EFileIOOperation.COPY_DIR_RECURSIVE], member[.aSourceDir]]]]
else begin[{]
None
end[}]
if[call[EqualsHelper.equals, parameter[member[.aSourceDir], member[.aTargetDir]]]] begin[{]
return[call[EFileIOErrorCode.SOURCE_EQUALS_TARGET.getAsIOError, parameter[member[EFileIOOperation.COPY_DIR_RECURSIVE], member[.aSourceDir]]]]
else begin[{]
None
end[}]
if[call[FileHelper.isParentDirectory, parameter[member[.aSourceDir], member[.aTargetDir]]]] begin[{]
return[call[EFileIOErrorCode.TARGET_IS_CHILD_OF_SOURCE.getAsIOError, parameter[member[EFileIOOperation.COPY_DIR_RECURSIVE], member[.aSourceDir], member[.aTargetDir]]]]
else begin[{]
None
end[}]
if[call[aTargetDir.exists, parameter[]]] begin[{]
return[call[EFileIOErrorCode.TARGET_ALREADY_EXISTS.getAsIOError, parameter[member[EFileIOOperation.COPY_DIR_RECURSIVE], member[.aTargetDir]]]]
else begin[{]
None
end[}]
if[call[aSourceDir.canRead, parameter[]]] begin[{]
return[call[EFileIOErrorCode.SOURCE_NOT_READABLE.getAsIOError, parameter[member[EFileIOOperation.COPY_DIR_RECURSIVE], member[.aSourceDir]]]]
else begin[{]
None
end[}]
local_variable[type[File], aTargetParentDir]
if[binary_operation[binary_operation[binary_operation[member[.aTargetParentDir], !=, literal[null]], &&, call[aTargetParentDir.exists, parameter[]]], &&, call[aTargetParentDir.canWrite, parameter[]]]] begin[{]
return[call[EFileIOErrorCode.TARGET_PARENT_NOT_WRITABLE.getAsIOError, parameter[member[EFileIOOperation.COPY_DIR_RECURSIVE], member[.aTargetDir]]]]
else begin[{]
None
end[}]
local_variable[type[FileIOError], eCode]
assign[member[.eCode], call[.createDirRecursive, parameter[member[.aTargetDir]]]]
if[call[eCode.isFailure, parameter[]]] begin[{]
return[member[.eCode]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=aChild, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=isFile, postfix_operators=[], prefix_operators=[], qualifier=aChild, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=COPY_DIR_RECURSIVE, postfix_operators=[], prefix_operators=[], qualifier=EFileIOOperation, selectors=[]), MemberReference(member=aChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAsIOError, postfix_operators=[], prefix_operators=[], qualifier=EFileIOErrorCode.OBJECT_CANNOT_BE_HANDLED, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=eCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=aChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=aTargetDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=aChild, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))], member=copyFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isFailure, postfix_operators=[], prefix_operators=[], qualifier=eCode, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=eCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=aChild, selectors=[], type_arguments=None)], member=isSystemInternalDirectory, postfix_operators=[], prefix_operators=[], qualifier=FilenameHelper, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=eCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=aChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=aTargetDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=aChild, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))], member=copyDirRecursive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isFailure, postfix_operators=[], prefix_operators=[], qualifier=eCode, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=eCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=aSourceDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDirectoryContent, postfix_operators=[], prefix_operators=[], qualifier=FileHelper, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aChild)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None)
return[call[EFileIOErrorCode.NO_ERROR.getAsIOError, parameter[member[EFileIOOperation.COPY_DIR_RECURSIVE], member[.aSourceDir], member[.aTargetDir]]]]
end[}]
END[}]
|
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[FileIOError] identifier[copyDirRecursive] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[File] identifier[aSourceDir] , annotation[@] identifier[Nonnull] Keyword[final] identifier[File] identifier[aTargetDir] operator[SEP] {
identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aSourceDir] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aTargetDir] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[FileHelper] operator[SEP] identifier[existsDir] operator[SEP] identifier[aSourceDir] operator[SEP] operator[SEP] Keyword[return] identifier[EFileIOErrorCode] operator[SEP] identifier[SOURCE_DOES_NOT_EXIST] operator[SEP] identifier[getAsIOError] operator[SEP] identifier[EFileIOOperation] operator[SEP] identifier[COPY_DIR_RECURSIVE] , identifier[aSourceDir] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[EqualsHelper] operator[SEP] identifier[equals] operator[SEP] identifier[aSourceDir] , identifier[aTargetDir] operator[SEP] operator[SEP] Keyword[return] identifier[EFileIOErrorCode] operator[SEP] identifier[SOURCE_EQUALS_TARGET] operator[SEP] identifier[getAsIOError] operator[SEP] identifier[EFileIOOperation] operator[SEP] identifier[COPY_DIR_RECURSIVE] , identifier[aSourceDir] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[FileHelper] operator[SEP] identifier[isParentDirectory] operator[SEP] identifier[aSourceDir] , identifier[aTargetDir] operator[SEP] operator[SEP] Keyword[return] identifier[EFileIOErrorCode] operator[SEP] identifier[TARGET_IS_CHILD_OF_SOURCE] operator[SEP] identifier[getAsIOError] operator[SEP] identifier[EFileIOOperation] operator[SEP] identifier[COPY_DIR_RECURSIVE] , identifier[aSourceDir] , identifier[aTargetDir] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aTargetDir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[EFileIOErrorCode] operator[SEP] identifier[TARGET_ALREADY_EXISTS] operator[SEP] identifier[getAsIOError] operator[SEP] identifier[EFileIOOperation] operator[SEP] identifier[COPY_DIR_RECURSIVE] , identifier[aTargetDir] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[aSourceDir] operator[SEP] identifier[canRead] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[EFileIOErrorCode] operator[SEP] identifier[SOURCE_NOT_READABLE] operator[SEP] identifier[getAsIOError] operator[SEP] identifier[EFileIOOperation] operator[SEP] identifier[COPY_DIR_RECURSIVE] , identifier[aSourceDir] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[aTargetParentDir] operator[=] identifier[aTargetDir] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aTargetParentDir] operator[!=] Other[null] operator[&&] identifier[aTargetParentDir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[aTargetParentDir] operator[SEP] identifier[canWrite] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[EFileIOErrorCode] operator[SEP] identifier[TARGET_PARENT_NOT_WRITABLE] operator[SEP] identifier[getAsIOError] operator[SEP] identifier[EFileIOOperation] operator[SEP] identifier[COPY_DIR_RECURSIVE] , identifier[aTargetDir] operator[SEP] operator[SEP] identifier[FileIOError] identifier[eCode] operator[SEP] identifier[eCode] operator[=] identifier[createDirRecursive] operator[SEP] identifier[aTargetDir] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eCode] operator[SEP] identifier[isFailure] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[eCode] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[File] identifier[aChild] operator[:] identifier[FileHelper] operator[SEP] identifier[getDirectoryContent] operator[SEP] identifier[aSourceDir] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[aChild] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[FilenameHelper] operator[SEP] identifier[isSystemInternalDirectory] operator[SEP] identifier[aChild] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[eCode] operator[=] identifier[copyDirRecursive] operator[SEP] identifier[aChild] , Keyword[new] identifier[File] operator[SEP] identifier[aTargetDir] , identifier[aChild] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eCode] operator[SEP] identifier[isFailure] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[eCode] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[aChild] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] {
identifier[eCode] operator[=] identifier[copyFile] operator[SEP] identifier[aChild] , Keyword[new] identifier[File] operator[SEP] identifier[aTargetDir] , identifier[aChild] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eCode] operator[SEP] identifier[isFailure] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[eCode] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[EFileIOErrorCode] operator[SEP] identifier[OBJECT_CANNOT_BE_HANDLED] operator[SEP] identifier[getAsIOError] operator[SEP] identifier[EFileIOOperation] operator[SEP] identifier[COPY_DIR_RECURSIVE] , identifier[aChild] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[EFileIOErrorCode] operator[SEP] identifier[NO_ERROR] operator[SEP] identifier[getAsIOError] operator[SEP] identifier[EFileIOOperation] operator[SEP] identifier[COPY_DIR_RECURSIVE] , identifier[aSourceDir] , identifier[aTargetDir] operator[SEP] operator[SEP]
}
|
public String restart(ZMsg hot)
{
ZMsg msg = new ZMsg();
msg.add(RESTART);
final boolean cold = hot == null;
if (cold) {
msg.add(Boolean.toString(false));
}
else {
msg.add(Boolean.toString(true));
msg.append(hot);
}
String status = EXITED;
if (agent.send(msg)) {
status = status(false);
}
return status;
}
|
class class_name[name] begin[{]
method[restart, return_type[type[String]], modifier[public], parameter[hot]] begin[{]
local_variable[type[ZMsg], msg]
call[msg.add, parameter[member[.RESTART]]]
local_variable[type[boolean], cold]
if[member[.cold]] begin[{]
call[msg.add, parameter[call[Boolean.toString, parameter[literal[false]]]]]
else begin[{]
call[msg.add, parameter[call[Boolean.toString, parameter[literal[true]]]]]
call[msg.append, parameter[member[.hot]]]
end[}]
local_variable[type[String], status]
if[call[agent.send, parameter[member[.msg]]]] begin[{]
assign[member[.status], call[.status, parameter[literal[false]]]]
else begin[{]
None
end[}]
return[member[.status]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[restart] operator[SEP] identifier[ZMsg] identifier[hot] operator[SEP] {
identifier[ZMsg] identifier[msg] operator[=] Keyword[new] identifier[ZMsg] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[add] operator[SEP] identifier[RESTART] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[cold] operator[=] identifier[hot] operator[==] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[cold] operator[SEP] {
identifier[msg] operator[SEP] identifier[add] operator[SEP] identifier[Boolean] operator[SEP] identifier[toString] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[msg] operator[SEP] identifier[add] operator[SEP] identifier[Boolean] operator[SEP] identifier[toString] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[hot] operator[SEP] operator[SEP]
}
identifier[String] identifier[status] operator[=] identifier[EXITED] operator[SEP] Keyword[if] operator[SEP] identifier[agent] operator[SEP] identifier[send] operator[SEP] identifier[msg] operator[SEP] operator[SEP] {
identifier[status] operator[=] identifier[status] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[return] identifier[status] operator[SEP]
}
|
public static boolean isAdmin(IPerson p) {
IAuthorizationPrincipal iap =
AuthorizationServiceFacade.instance()
.newPrincipal(
p.getEntityIdentifier().getKey(),
p.getEntityIdentifier().getType());
return isAdmin(iap);
}
|
class class_name[name] begin[{]
method[isAdmin, return_type[type[boolean]], modifier[public static], parameter[p]] begin[{]
local_variable[type[IAuthorizationPrincipal], iap]
return[call[.isAdmin, parameter[member[.iap]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[isAdmin] operator[SEP] identifier[IPerson] identifier[p] operator[SEP] {
identifier[IAuthorizationPrincipal] identifier[iap] operator[=] identifier[AuthorizationServiceFacade] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[newPrincipal] operator[SEP] identifier[p] operator[SEP] identifier[getEntityIdentifier] operator[SEP] operator[SEP] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[p] operator[SEP] identifier[getEntityIdentifier] operator[SEP] operator[SEP] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[isAdmin] operator[SEP] identifier[iap] operator[SEP] operator[SEP]
}
|
private void deleteInternal(List<FileInfo> itemsToDelete, List<FileInfo> bucketsToDelete)
throws IOException {
// TODO(user): We might need to separate out children into separate batches from parents to
// avoid deleting a parent before somehow failing to delete a child.
// Delete children before their parents.
//
// Note: we modify the input list, which is ok for current usage.
// We should make a copy in case that changes in future.
itemsToDelete.sort(FILE_INFO_PATH_COMPARATOR.reversed());
if (!itemsToDelete.isEmpty()) {
List<StorageResourceId> objectsToDelete = new ArrayList<>(itemsToDelete.size());
for (FileInfo fileInfo : itemsToDelete) {
// TODO(b/110833109): populate generation ID in StorageResourceId when listing infos?
objectsToDelete.add(
new StorageResourceId(
fileInfo.getItemInfo().getBucketName(),
fileInfo.getItemInfo().getObjectName(),
fileInfo.getItemInfo().getContentGeneration()));
}
gcs.deleteObjects(objectsToDelete);
}
if (!bucketsToDelete.isEmpty()) {
List<String> bucketNames = new ArrayList<>(bucketsToDelete.size());
for (FileInfo bucketInfo : bucketsToDelete) {
StorageResourceId resourceId = bucketInfo.getItemInfo().getResourceId();
gcs.waitForBucketEmpty(resourceId.getBucketName());
bucketNames.add(resourceId.getBucketName());
}
if (options.enableBucketDelete()) {
gcs.deleteBuckets(bucketNames);
} else {
logger.atInfo().log(
"Skipping deletion of buckets because enableBucketDelete is false: %s", bucketNames);
}
}
}
|
class class_name[name] begin[{]
method[deleteInternal, return_type[void], modifier[private], parameter[itemsToDelete, bucketsToDelete]] begin[{]
call[itemsToDelete.sort, parameter[call[FILE_INFO_PATH_COMPARATOR.reversed, parameter[]]]]
if[call[itemsToDelete.isEmpty, parameter[]]] begin[{]
local_variable[type[List], objectsToDelete]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getItemInfo, postfix_operators=[], prefix_operators=[], qualifier=fileInfo, selectors=[MethodInvocation(arguments=[], member=getBucketName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getItemInfo, postfix_operators=[], prefix_operators=[], qualifier=fileInfo, selectors=[MethodInvocation(arguments=[], member=getObjectName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getItemInfo, postfix_operators=[], prefix_operators=[], qualifier=fileInfo, selectors=[MethodInvocation(arguments=[], member=getContentGeneration, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StorageResourceId, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=objectsToDelete, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=itemsToDelete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fileInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileInfo, sub_type=None))), label=None)
call[gcs.deleteObjects, parameter[member[.objectsToDelete]]]
else begin[{]
None
end[}]
if[call[bucketsToDelete.isEmpty, parameter[]]] begin[{]
local_variable[type[List], bucketNames]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getItemInfo, postfix_operators=[], prefix_operators=[], qualifier=bucketInfo, selectors=[MethodInvocation(arguments=[], member=getResourceId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=resourceId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StorageResourceId, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBucketName, postfix_operators=[], prefix_operators=[], qualifier=resourceId, selectors=[], type_arguments=None)], member=waitForBucketEmpty, postfix_operators=[], prefix_operators=[], qualifier=gcs, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBucketName, postfix_operators=[], prefix_operators=[], qualifier=resourceId, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=bucketNames, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=bucketsToDelete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bucketInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileInfo, sub_type=None))), label=None)
if[call[options.enableBucketDelete, parameter[]]] begin[{]
call[gcs.deleteBuckets, parameter[member[.bucketNames]]]
else begin[{]
call[logger.atInfo, parameter[]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[deleteInternal] operator[SEP] identifier[List] operator[<] identifier[FileInfo] operator[>] identifier[itemsToDelete] , identifier[List] operator[<] identifier[FileInfo] operator[>] identifier[bucketsToDelete] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[itemsToDelete] operator[SEP] identifier[sort] operator[SEP] identifier[FILE_INFO_PATH_COMPARATOR] operator[SEP] identifier[reversed] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[itemsToDelete] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[StorageResourceId] operator[>] identifier[objectsToDelete] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[itemsToDelete] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FileInfo] identifier[fileInfo] operator[:] identifier[itemsToDelete] operator[SEP] {
identifier[objectsToDelete] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[StorageResourceId] operator[SEP] identifier[fileInfo] operator[SEP] identifier[getItemInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getBucketName] operator[SEP] operator[SEP] , identifier[fileInfo] operator[SEP] identifier[getItemInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getObjectName] operator[SEP] operator[SEP] , identifier[fileInfo] operator[SEP] identifier[getItemInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getContentGeneration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[gcs] operator[SEP] identifier[deleteObjects] operator[SEP] identifier[objectsToDelete] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[bucketsToDelete] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[bucketNames] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[bucketsToDelete] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FileInfo] identifier[bucketInfo] operator[:] identifier[bucketsToDelete] operator[SEP] {
identifier[StorageResourceId] identifier[resourceId] operator[=] identifier[bucketInfo] operator[SEP] identifier[getItemInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceId] operator[SEP] operator[SEP] operator[SEP] identifier[gcs] operator[SEP] identifier[waitForBucketEmpty] operator[SEP] identifier[resourceId] operator[SEP] identifier[getBucketName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bucketNames] operator[SEP] identifier[add] operator[SEP] identifier[resourceId] operator[SEP] identifier[getBucketName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[enableBucketDelete] operator[SEP] operator[SEP] operator[SEP] {
identifier[gcs] operator[SEP] identifier[deleteBuckets] operator[SEP] identifier[bucketNames] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[logger] operator[SEP] identifier[atInfo] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] literal[String] , identifier[bucketNames] operator[SEP] operator[SEP]
}
}
}
|
public void update(final double datum) {
final double d = (datum == 0.0) ? 0.0 : datum; // canonicalize -0.0, 0.0
final long[] data = { Double.doubleToLongBits(d) };// canonicalize all NaN forms
final long[] arr = hash(data, seed);
hashUpdate(arr[0], arr[1]);
}
|
class class_name[name] begin[{]
method[update, return_type[void], modifier[public], parameter[datum]] begin[{]
local_variable[type[double], d]
local_variable[type[long], data]
local_variable[type[long], arr]
call[.hashUpdate, parameter[member[.arr], member[.arr]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[update] operator[SEP] Keyword[final] Keyword[double] identifier[datum] operator[SEP] {
Keyword[final] Keyword[double] identifier[d] operator[=] operator[SEP] identifier[datum] operator[==] literal[Float] operator[SEP] operator[?] literal[Float] operator[:] identifier[datum] operator[SEP] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[data] operator[=] {
identifier[Double] operator[SEP] identifier[doubleToLongBits] operator[SEP] identifier[d] operator[SEP]
} operator[SEP] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[arr] operator[=] identifier[hash] operator[SEP] identifier[data] , identifier[seed] operator[SEP] operator[SEP] identifier[hashUpdate] operator[SEP] identifier[arr] operator[SEP] Other[0] operator[SEP] , identifier[arr] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
|
@JsonValue
public CharSequence render()
{
if (statement == null)
{
statement = new StringBuilder();
statement.append("function(");
statement.append(scopeContext.scopeDeclaration());
statement.append(") {\n");
execute(scopeContext);
statement.append(scopeContext.render());
closeScope();
}
return statement.toString();
}
|
class class_name[name] begin[{]
method[render, return_type[type[CharSequence]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.statement], ==, literal[null]]] begin[{]
assign[member[.statement], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))]
call[statement.append, parameter[literal["function("]]]
call[statement.append, parameter[call[scopeContext.scopeDeclaration, parameter[]]]]
call[statement.append, parameter[literal[") {\n"]]]
call[.execute, parameter[member[.scopeContext]]]
call[statement.append, parameter[call[scopeContext.render, parameter[]]]]
call[.closeScope, parameter[]]
else begin[{]
None
end[}]
return[call[statement.toString, parameter[]]]
end[}]
END[}]
|
annotation[@] identifier[JsonValue] Keyword[public] identifier[CharSequence] identifier[render] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[statement] operator[==] Other[null] operator[SEP] {
identifier[statement] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[append] operator[SEP] identifier[scopeContext] operator[SEP] identifier[scopeDeclaration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[execute] operator[SEP] identifier[scopeContext] operator[SEP] operator[SEP] identifier[statement] operator[SEP] identifier[append] operator[SEP] identifier[scopeContext] operator[SEP] identifier[render] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[closeScope] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[statement] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public DescribeAutoScalingGroupsRequest withAutoScalingGroupNames(String... autoScalingGroupNames) {
if (this.autoScalingGroupNames == null) {
setAutoScalingGroupNames(new com.amazonaws.internal.SdkInternalList<String>(autoScalingGroupNames.length));
}
for (String ele : autoScalingGroupNames) {
this.autoScalingGroupNames.add(ele);
}
return this;
}
|
class class_name[name] begin[{]
method[withAutoScalingGroupNames, return_type[type[DescribeAutoScalingGroupsRequest]], modifier[public], parameter[autoScalingGroupNames]] begin[{]
if[binary_operation[THIS[member[None.autoScalingGroupNames]], ==, literal[null]]] begin[{]
call[.setAutoScalingGroupNames, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=autoScalingGroupNames, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=autoScalingGroupNames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=autoScalingGroupNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[DescribeAutoScalingGroupsRequest] identifier[withAutoScalingGroupNames] operator[SEP] identifier[String] operator[...] identifier[autoScalingGroupNames] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[autoScalingGroupNames] operator[==] Other[null] operator[SEP] {
identifier[setAutoScalingGroupNames] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[autoScalingGroupNames] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[autoScalingGroupNames] operator[SEP] {
Keyword[this] operator[SEP] identifier[autoScalingGroupNames] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public void setRuntimeInfoFactory(String className) {
Object objectInstance;
try {
objectInstance = Class.forName(className).newInstance();
} catch (Throwable t) {
LOG.error(Messages.get().getBundle().key(Messages.LOG_CLASS_INIT_FAILURE_1, className), t);
return;
}
if (objectInstance instanceof I_CmsDbContextFactory) {
m_runtimeInfoFactory = (I_CmsDbContextFactory)objectInstance;
if (CmsLog.INIT.isInfoEnabled()) {
CmsLog.INIT.info(
Messages.get().getBundle().key(Messages.INIT_RUNTIME_INFO_FACTORY_SUCCESS_1, className));
}
} else {
if (CmsLog.INIT.isFatalEnabled()) {
CmsLog.INIT.fatal(
Messages.get().getBundle().key(Messages.INIT_RUNTIME_INFO_FACTORY_FAILURE_1, className));
}
}
}
|
class class_name[name] begin[{]
method[setRuntimeInfoFactory, return_type[void], modifier[public], parameter[className]] begin[{]
local_variable[type[Object], objectInstance]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=objectInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=LOG_CLASS_INIT_FAILURE_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)
if[binary_operation[member[.objectInstance], instanceof, type[I_CmsDbContextFactory]]] begin[{]
assign[member[.m_runtimeInfoFactory], Cast(expression=MemberReference(member=objectInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsDbContextFactory, sub_type=None))]
if[call[CmsLog.INIT.isInfoEnabled, parameter[]]] begin[{]
call[CmsLog.INIT.info, parameter[call[Messages.get, parameter[]]]]
else begin[{]
None
end[}]
else begin[{]
if[call[CmsLog.INIT.isFatalEnabled, parameter[]]] begin[{]
call[CmsLog.INIT.fatal, parameter[call[Messages.get, parameter[]]]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setRuntimeInfoFactory] operator[SEP] identifier[String] identifier[className] operator[SEP] {
identifier[Object] identifier[objectInstance] operator[SEP] Keyword[try] {
identifier[objectInstance] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[className] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_CLASS_INIT_FAILURE_1] , identifier[className] operator[SEP] , identifier[t] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[objectInstance] Keyword[instanceof] identifier[I_CmsDbContextFactory] operator[SEP] {
identifier[m_runtimeInfoFactory] operator[=] operator[SEP] identifier[I_CmsDbContextFactory] operator[SEP] identifier[objectInstance] operator[SEP] Keyword[if] operator[SEP] identifier[CmsLog] operator[SEP] identifier[INIT] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[CmsLog] operator[SEP] identifier[INIT] operator[SEP] identifier[info] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[INIT_RUNTIME_INFO_FACTORY_SUCCESS_1] , identifier[className] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[CmsLog] operator[SEP] identifier[INIT] operator[SEP] identifier[isFatalEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[CmsLog] operator[SEP] identifier[INIT] operator[SEP] identifier[fatal] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[INIT_RUNTIME_INFO_FACTORY_FAILURE_1] , identifier[className] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public void marshall(CreateGameSessionRequest createGameSessionRequest, ProtocolMarshaller protocolMarshaller) {
if (createGameSessionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createGameSessionRequest.getFleetId(), FLEETID_BINDING);
protocolMarshaller.marshall(createGameSessionRequest.getAliasId(), ALIASID_BINDING);
protocolMarshaller.marshall(createGameSessionRequest.getMaximumPlayerSessionCount(), MAXIMUMPLAYERSESSIONCOUNT_BINDING);
protocolMarshaller.marshall(createGameSessionRequest.getName(), NAME_BINDING);
protocolMarshaller.marshall(createGameSessionRequest.getGameProperties(), GAMEPROPERTIES_BINDING);
protocolMarshaller.marshall(createGameSessionRequest.getCreatorId(), CREATORID_BINDING);
protocolMarshaller.marshall(createGameSessionRequest.getGameSessionId(), GAMESESSIONID_BINDING);
protocolMarshaller.marshall(createGameSessionRequest.getIdempotencyToken(), IDEMPOTENCYTOKEN_BINDING);
protocolMarshaller.marshall(createGameSessionRequest.getGameSessionData(), GAMESESSIONDATA_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[createGameSessionRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.createGameSessionRequest], ==, 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=getFleetId, postfix_operators=[], prefix_operators=[], qualifier=createGameSessionRequest, selectors=[], type_arguments=None), MemberReference(member=FLEETID_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=getAliasId, postfix_operators=[], prefix_operators=[], qualifier=createGameSessionRequest, selectors=[], type_arguments=None), MemberReference(member=ALIASID_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=getMaximumPlayerSessionCount, postfix_operators=[], prefix_operators=[], qualifier=createGameSessionRequest, selectors=[], type_arguments=None), MemberReference(member=MAXIMUMPLAYERSESSIONCOUNT_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=getName, postfix_operators=[], prefix_operators=[], qualifier=createGameSessionRequest, selectors=[], type_arguments=None), MemberReference(member=NAME_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=getGameProperties, postfix_operators=[], prefix_operators=[], qualifier=createGameSessionRequest, selectors=[], type_arguments=None), MemberReference(member=GAMEPROPERTIES_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=getCreatorId, postfix_operators=[], prefix_operators=[], qualifier=createGameSessionRequest, selectors=[], type_arguments=None), MemberReference(member=CREATORID_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=getGameSessionId, postfix_operators=[], prefix_operators=[], qualifier=createGameSessionRequest, selectors=[], type_arguments=None), MemberReference(member=GAMESESSIONID_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=getIdempotencyToken, postfix_operators=[], prefix_operators=[], qualifier=createGameSessionRequest, selectors=[], type_arguments=None), MemberReference(member=IDEMPOTENCYTOKEN_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=getGameSessionData, postfix_operators=[], prefix_operators=[], qualifier=createGameSessionRequest, selectors=[], type_arguments=None), MemberReference(member=GAMESESSIONDATA_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[CreateGameSessionRequest] identifier[createGameSessionRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[createGameSessionRequest] 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[createGameSessionRequest] operator[SEP] identifier[getFleetId] operator[SEP] operator[SEP] , identifier[FLEETID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGameSessionRequest] operator[SEP] identifier[getAliasId] operator[SEP] operator[SEP] , identifier[ALIASID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGameSessionRequest] operator[SEP] identifier[getMaximumPlayerSessionCount] operator[SEP] operator[SEP] , identifier[MAXIMUMPLAYERSESSIONCOUNT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGameSessionRequest] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGameSessionRequest] operator[SEP] identifier[getGameProperties] operator[SEP] operator[SEP] , identifier[GAMEPROPERTIES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGameSessionRequest] operator[SEP] identifier[getCreatorId] operator[SEP] operator[SEP] , identifier[CREATORID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGameSessionRequest] operator[SEP] identifier[getGameSessionId] operator[SEP] operator[SEP] , identifier[GAMESESSIONID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGameSessionRequest] operator[SEP] identifier[getIdempotencyToken] operator[SEP] operator[SEP] , identifier[IDEMPOTENCYTOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGameSessionRequest] operator[SEP] identifier[getGameSessionData] operator[SEP] operator[SEP] , identifier[GAMESESSIONDATA_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private void getDirPropsMemory(boolean mayAllocate, int len)
{
Object array = getMemory("DirProps", dirPropsMemory, Byte.TYPE, mayAllocate, len);
dirPropsMemory = (byte[]) array;
}
|
class class_name[name] begin[{]
method[getDirPropsMemory, return_type[void], modifier[private], parameter[mayAllocate, len]] begin[{]
local_variable[type[Object], array]
assign[member[.dirPropsMemory], Cast(expression=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=byte))]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[getDirPropsMemory] operator[SEP] Keyword[boolean] identifier[mayAllocate] , Keyword[int] identifier[len] operator[SEP] {
identifier[Object] identifier[array] operator[=] identifier[getMemory] operator[SEP] literal[String] , identifier[dirPropsMemory] , identifier[Byte] operator[SEP] identifier[TYPE] , identifier[mayAllocate] , identifier[len] operator[SEP] operator[SEP] identifier[dirPropsMemory] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[array] operator[SEP]
}
|
public static void pack(ZipEntrySource[] entries, OutputStream os) {
if (log.isDebugEnabled()) {
log.debug("Creating stream from {}.", Arrays.asList(entries));
}
pack(entries, os, false);
}
|
class class_name[name] begin[{]
method[pack, return_type[void], modifier[public static], parameter[entries, os]] begin[{]
if[call[log.isDebugEnabled, parameter[]]] begin[{]
call[log.debug, parameter[literal["Creating stream from {}."], call[Arrays.asList, parameter[member[.entries]]]]]
else begin[{]
None
end[}]
call[.pack, parameter[member[.entries], member[.os], literal[false]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[pack] operator[SEP] identifier[ZipEntrySource] operator[SEP] operator[SEP] identifier[entries] , identifier[OutputStream] identifier[os] 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] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pack] operator[SEP] identifier[entries] , identifier[os] , literal[boolean] operator[SEP] operator[SEP]
}
|
public void startMcGregorIteration(int largestMappingSize, List<Integer> cliqueVector,
List<Integer> compGraphNodes) throws IOException {
this.globalMCSSize = (largestMappingSize / 2);
List<String> cTab1Copy = McGregorChecks.generateCTabCopy(source);
List<String> cTab2Copy = McGregorChecks.generateCTabCopy(target);
//find mapped atoms of both molecules and store these in mappedAtoms
List<Integer> mappedAtoms = new ArrayList<Integer>();
int mappedAtomCount = 0;
List<Integer> iBondNeighborAtomsA = new ArrayList<Integer>();
List<String> cBondNeighborsA = new ArrayList<String>();
List<Integer> iBondSetA = new ArrayList<Integer>();
List<String> cBondSetA = new ArrayList<String>();
List<Integer> iBondNeighborAtomsB = new ArrayList<Integer>();
List<Integer> iBondSetB = new ArrayList<Integer>();
List<String> cBondNeighborsB = new ArrayList<String>();
List<String> cBondSetB = new ArrayList<String>();
int cliqueSize = cliqueVector.size();
int vecSize = compGraphNodes.size();
int cliqueNumber = 0;
for (int a = 0; a < cliqueSize; a++) {
//go through all clique nodes
cliqueNumber = cliqueVector.get(a);
for (int b = 0; b < vecSize; b += 3) {
//go through all nodes in the compatibility graph
if (cliqueNumber == compGraphNodes.get(b + 2)) {
mappedAtoms.add(compGraphNodes.get(b));
mappedAtoms.add(compGraphNodes.get(b + 1));
mappedAtomCount++;
}
}
}
//find unmapped atoms of molecule A
List<Integer> unmappedAtomsMolA = McGregorChecks.markUnMappedAtoms(true, source, mappedAtoms, cliqueSize);
int counter = 0;
int setNumA = 0;
int setNumB = 0;
int localNeighborBondnumA = 0; //number of remaining molecule A bonds after the clique search, which are neighbors of the MCS_1
int localNeighborBondNumB = 0; //number of remaining molecule B bonds after the clique search, which are neighbors of the MCS_1
//Extract bonds which are related with unmapped atoms of molecule A.
//In case that unmapped atoms are connected with already mapped atoms, the mapped atoms are labelled with
//new special signs -> the result are two vectors: cBondNeighborsA and int_bonds_molA, which contain those
//bonds of molecule A, which are relevant for the McGregorBondTypeInSensitive algorithm.
//The special signs must be transfered to the corresponding atoms of molecule B
QueryProcessor queryProcess = new QueryProcessor(cTab1Copy, cTab2Copy, SIGNS, localNeighborBondnumA,
setNumA, iBondNeighborAtomsA, cBondNeighborsA, cliqueSize, iBondSetA, cBondSetA);
queryProcess.process(source, target, unmappedAtomsMolA, mappedAtoms, counter);
cTab1Copy = queryProcess.getCTab1();
cTab2Copy = queryProcess.getCTab2();
setNumA = queryProcess.getBondNumA();
localNeighborBondnumA = queryProcess.getNeighborBondNumA();
iBondNeighborAtomsA = queryProcess.getIBondNeighboursA();
cBondNeighborsA = queryProcess.getCBondNeighborsA();
//find unmapped atoms of molecule B
List<Integer> unmappedAtomsMolB = McGregorChecks.markUnMappedAtoms(false, target, mappedAtoms, cliqueSize);
//Extract bonds which are related with unmapped atoms of molecule B.
//In case that unmapped atoms are connected with already mapped atoms, the mapped atoms are labelled with
//new special signs -> the result are two vectors: cBondNeighborsA and int_bonds_molB, which contain those
//bonds of molecule B, which are relevant for the McGregorBondTypeInSensitive algorithm.
//The special signs must be transfered to the corresponding atoms of molecule A
TargetProcessor targetProcess = new TargetProcessor(cTab1Copy, cTab2Copy, SIGNS, localNeighborBondNumB,
setNumB, iBondNeighborAtomsB, cBondNeighborsB, localNeighborBondnumA, iBondNeighborAtomsA,
cBondNeighborsA);
targetProcess.process(target, unmappedAtomsMolB, cliqueSize, iBondSetB, cBondSetB, mappedAtoms, counter);
cTab1Copy = targetProcess.getCTab1();
cTab2Copy = targetProcess.getCTab2();
setNumB = targetProcess.getBondNumB();
localNeighborBondNumB = targetProcess.getNeighborBondNumB();
iBondNeighborAtomsB = targetProcess.getIBondNeighboursB();
cBondNeighborsB = targetProcess.getCBondNeighborsB();
boolean dummy = false;
McgregorHelper mcGregorHelper = new McgregorHelper(dummy, mappedAtomCount, mappedAtoms, localNeighborBondnumA,
localNeighborBondNumB, iBondNeighborAtomsA, iBondNeighborAtomsB, cBondNeighborsA, cBondNeighborsB,
setNumA, setNumB, iBondSetA, iBondSetB, cBondSetA, cBondSetB);
iterator(mcGregorHelper);
}
|
class class_name[name] begin[{]
method[startMcGregorIteration, return_type[void], modifier[public], parameter[largestMappingSize, cliqueVector, compGraphNodes]] begin[{]
assign[THIS[member[None.globalMCSSize]], binary_operation[member[.largestMappingSize], /, literal[2]]]
local_variable[type[List], cTab1Copy]
local_variable[type[List], cTab2Copy]
local_variable[type[List], mappedAtoms]
local_variable[type[int], mappedAtomCount]
local_variable[type[List], iBondNeighborAtomsA]
local_variable[type[List], cBondNeighborsA]
local_variable[type[List], iBondSetA]
local_variable[type[List], cBondSetA]
local_variable[type[List], iBondNeighborAtomsB]
local_variable[type[List], iBondSetB]
local_variable[type[List], cBondNeighborsB]
local_variable[type[List], cBondSetB]
local_variable[type[int], cliqueSize]
local_variable[type[int], vecSize]
local_variable[type[int], cliqueNumber]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cliqueNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cliqueVector, selectors=[], type_arguments=None)), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cliqueNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=compGraphNodes, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=compGraphNodes, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=mappedAtoms, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=compGraphNodes, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=mappedAtoms, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=mappedAtomCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=vecSize, 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=b)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=cliqueSize, 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=a)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=a, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[List], unmappedAtomsMolA]
local_variable[type[int], counter]
local_variable[type[int], setNumA]
local_variable[type[int], setNumB]
local_variable[type[int], localNeighborBondnumA]
local_variable[type[int], localNeighborBondNumB]
local_variable[type[QueryProcessor], queryProcess]
call[queryProcess.process, parameter[member[.source], member[.target], member[.unmappedAtomsMolA], member[.mappedAtoms], member[.counter]]]
assign[member[.cTab1Copy], call[queryProcess.getCTab1, parameter[]]]
assign[member[.cTab2Copy], call[queryProcess.getCTab2, parameter[]]]
assign[member[.setNumA], call[queryProcess.getBondNumA, parameter[]]]
assign[member[.localNeighborBondnumA], call[queryProcess.getNeighborBondNumA, parameter[]]]
assign[member[.iBondNeighborAtomsA], call[queryProcess.getIBondNeighboursA, parameter[]]]
assign[member[.cBondNeighborsA], call[queryProcess.getCBondNeighborsA, parameter[]]]
local_variable[type[List], unmappedAtomsMolB]
local_variable[type[TargetProcessor], targetProcess]
call[targetProcess.process, parameter[member[.target], member[.unmappedAtomsMolB], member[.cliqueSize], member[.iBondSetB], member[.cBondSetB], member[.mappedAtoms], member[.counter]]]
assign[member[.cTab1Copy], call[targetProcess.getCTab1, parameter[]]]
assign[member[.cTab2Copy], call[targetProcess.getCTab2, parameter[]]]
assign[member[.setNumB], call[targetProcess.getBondNumB, parameter[]]]
assign[member[.localNeighborBondNumB], call[targetProcess.getNeighborBondNumB, parameter[]]]
assign[member[.iBondNeighborAtomsB], call[targetProcess.getIBondNeighboursB, parameter[]]]
assign[member[.cBondNeighborsB], call[targetProcess.getCBondNeighborsB, parameter[]]]
local_variable[type[boolean], dummy]
local_variable[type[McgregorHelper], mcGregorHelper]
call[.iterator, parameter[member[.mcGregorHelper]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[startMcGregorIteration] operator[SEP] Keyword[int] identifier[largestMappingSize] , identifier[List] operator[<] identifier[Integer] operator[>] identifier[cliqueVector] , identifier[List] operator[<] identifier[Integer] operator[>] identifier[compGraphNodes] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[this] operator[SEP] identifier[globalMCSSize] operator[=] operator[SEP] identifier[largestMappingSize] operator[/] Other[2] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[cTab1Copy] operator[=] identifier[McGregorChecks] operator[SEP] identifier[generateCTabCopy] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[cTab2Copy] operator[=] identifier[McGregorChecks] operator[SEP] identifier[generateCTabCopy] operator[SEP] identifier[target] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[mappedAtoms] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[mappedAtomCount] operator[=] Other[0] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[iBondNeighborAtomsA] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[cBondNeighborsA] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[iBondSetA] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[cBondSetA] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[iBondNeighborAtomsB] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[iBondSetB] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[cBondNeighborsB] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[cBondSetB] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[cliqueSize] operator[=] identifier[cliqueVector] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[vecSize] operator[=] identifier[compGraphNodes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[cliqueNumber] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[a] operator[=] Other[0] operator[SEP] identifier[a] operator[<] identifier[cliqueSize] operator[SEP] identifier[a] operator[++] operator[SEP] {
identifier[cliqueNumber] operator[=] identifier[cliqueVector] operator[SEP] identifier[get] operator[SEP] identifier[a] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[b] operator[=] Other[0] operator[SEP] identifier[b] operator[<] identifier[vecSize] operator[SEP] identifier[b] operator[+=] Other[3] operator[SEP] {
Keyword[if] operator[SEP] identifier[cliqueNumber] operator[==] identifier[compGraphNodes] operator[SEP] identifier[get] operator[SEP] identifier[b] operator[+] Other[2] operator[SEP] operator[SEP] {
identifier[mappedAtoms] operator[SEP] identifier[add] operator[SEP] identifier[compGraphNodes] operator[SEP] identifier[get] operator[SEP] identifier[b] operator[SEP] operator[SEP] operator[SEP] identifier[mappedAtoms] operator[SEP] identifier[add] operator[SEP] identifier[compGraphNodes] operator[SEP] identifier[get] operator[SEP] identifier[b] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[mappedAtomCount] operator[++] operator[SEP]
}
}
}
identifier[List] operator[<] identifier[Integer] operator[>] identifier[unmappedAtomsMolA] operator[=] identifier[McGregorChecks] operator[SEP] identifier[markUnMappedAtoms] operator[SEP] literal[boolean] , identifier[source] , identifier[mappedAtoms] , identifier[cliqueSize] operator[SEP] operator[SEP] Keyword[int] identifier[counter] operator[=] Other[0] operator[SEP] Keyword[int] identifier[setNumA] operator[=] Other[0] operator[SEP] Keyword[int] identifier[setNumB] operator[=] Other[0] operator[SEP] Keyword[int] identifier[localNeighborBondnumA] operator[=] Other[0] operator[SEP] Keyword[int] identifier[localNeighborBondNumB] operator[=] Other[0] operator[SEP] identifier[QueryProcessor] identifier[queryProcess] operator[=] Keyword[new] identifier[QueryProcessor] operator[SEP] identifier[cTab1Copy] , identifier[cTab2Copy] , identifier[SIGNS] , identifier[localNeighborBondnumA] , identifier[setNumA] , identifier[iBondNeighborAtomsA] , identifier[cBondNeighborsA] , identifier[cliqueSize] , identifier[iBondSetA] , identifier[cBondSetA] operator[SEP] operator[SEP] identifier[queryProcess] operator[SEP] identifier[process] operator[SEP] identifier[source] , identifier[target] , identifier[unmappedAtomsMolA] , identifier[mappedAtoms] , identifier[counter] operator[SEP] operator[SEP] identifier[cTab1Copy] operator[=] identifier[queryProcess] operator[SEP] identifier[getCTab1] operator[SEP] operator[SEP] operator[SEP] identifier[cTab2Copy] operator[=] identifier[queryProcess] operator[SEP] identifier[getCTab2] operator[SEP] operator[SEP] operator[SEP] identifier[setNumA] operator[=] identifier[queryProcess] operator[SEP] identifier[getBondNumA] operator[SEP] operator[SEP] operator[SEP] identifier[localNeighborBondnumA] operator[=] identifier[queryProcess] operator[SEP] identifier[getNeighborBondNumA] operator[SEP] operator[SEP] operator[SEP] identifier[iBondNeighborAtomsA] operator[=] identifier[queryProcess] operator[SEP] identifier[getIBondNeighboursA] operator[SEP] operator[SEP] operator[SEP] identifier[cBondNeighborsA] operator[=] identifier[queryProcess] operator[SEP] identifier[getCBondNeighborsA] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[unmappedAtomsMolB] operator[=] identifier[McGregorChecks] operator[SEP] identifier[markUnMappedAtoms] operator[SEP] literal[boolean] , identifier[target] , identifier[mappedAtoms] , identifier[cliqueSize] operator[SEP] operator[SEP] identifier[TargetProcessor] identifier[targetProcess] operator[=] Keyword[new] identifier[TargetProcessor] operator[SEP] identifier[cTab1Copy] , identifier[cTab2Copy] , identifier[SIGNS] , identifier[localNeighborBondNumB] , identifier[setNumB] , identifier[iBondNeighborAtomsB] , identifier[cBondNeighborsB] , identifier[localNeighborBondnumA] , identifier[iBondNeighborAtomsA] , identifier[cBondNeighborsA] operator[SEP] operator[SEP] identifier[targetProcess] operator[SEP] identifier[process] operator[SEP] identifier[target] , identifier[unmappedAtomsMolB] , identifier[cliqueSize] , identifier[iBondSetB] , identifier[cBondSetB] , identifier[mappedAtoms] , identifier[counter] operator[SEP] operator[SEP] identifier[cTab1Copy] operator[=] identifier[targetProcess] operator[SEP] identifier[getCTab1] operator[SEP] operator[SEP] operator[SEP] identifier[cTab2Copy] operator[=] identifier[targetProcess] operator[SEP] identifier[getCTab2] operator[SEP] operator[SEP] operator[SEP] identifier[setNumB] operator[=] identifier[targetProcess] operator[SEP] identifier[getBondNumB] operator[SEP] operator[SEP] operator[SEP] identifier[localNeighborBondNumB] operator[=] identifier[targetProcess] operator[SEP] identifier[getNeighborBondNumB] operator[SEP] operator[SEP] operator[SEP] identifier[iBondNeighborAtomsB] operator[=] identifier[targetProcess] operator[SEP] identifier[getIBondNeighboursB] operator[SEP] operator[SEP] operator[SEP] identifier[cBondNeighborsB] operator[=] identifier[targetProcess] operator[SEP] identifier[getCBondNeighborsB] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[dummy] operator[=] literal[boolean] operator[SEP] identifier[McgregorHelper] identifier[mcGregorHelper] operator[=] Keyword[new] identifier[McgregorHelper] operator[SEP] identifier[dummy] , identifier[mappedAtomCount] , identifier[mappedAtoms] , identifier[localNeighborBondnumA] , identifier[localNeighborBondNumB] , identifier[iBondNeighborAtomsA] , identifier[iBondNeighborAtomsB] , identifier[cBondNeighborsA] , identifier[cBondNeighborsB] , identifier[setNumA] , identifier[setNumB] , identifier[iBondSetA] , identifier[iBondSetB] , identifier[cBondSetA] , identifier[cBondSetB] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] identifier[mcGregorHelper] operator[SEP] operator[SEP]
}
|
public Bits concatenate(final Bits right) {
final int newBitLength = this.bitLength + right.bitLength;
final int newByteLength = (int) Math.ceil(newBitLength / 8.);
final Bits result = new Bits(new byte[newByteLength], newBitLength);
shiftLeft(this.bytes, 0, result.bytes);
shiftRight(right.bytes, this.bitLength, result.bytes);
return result;
}
|
class class_name[name] begin[{]
method[concatenate, return_type[type[Bits]], modifier[public], parameter[right]] begin[{]
local_variable[type[int], newBitLength]
local_variable[type[int], newByteLength]
local_variable[type[Bits], result]
call[.shiftLeft, parameter[THIS[member[None.bytes]], literal[0], member[result.bytes]]]
call[.shiftRight, parameter[member[right.bytes], THIS[member[None.bitLength]], member[result.bytes]]]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] identifier[Bits] identifier[concatenate] operator[SEP] Keyword[final] identifier[Bits] identifier[right] operator[SEP] {
Keyword[final] Keyword[int] identifier[newBitLength] operator[=] Keyword[this] operator[SEP] identifier[bitLength] operator[+] identifier[right] operator[SEP] identifier[bitLength] operator[SEP] Keyword[final] Keyword[int] identifier[newByteLength] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[ceil] operator[SEP] identifier[newBitLength] operator[/] literal[Float] operator[SEP] operator[SEP] Keyword[final] identifier[Bits] identifier[result] operator[=] Keyword[new] identifier[Bits] operator[SEP] Keyword[new] Keyword[byte] operator[SEP] identifier[newByteLength] operator[SEP] , identifier[newBitLength] operator[SEP] operator[SEP] identifier[shiftLeft] operator[SEP] Keyword[this] operator[SEP] identifier[bytes] , Other[0] , identifier[result] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] identifier[shiftRight] operator[SEP] identifier[right] operator[SEP] identifier[bytes] , Keyword[this] operator[SEP] identifier[bitLength] , identifier[result] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public WorkUnit createWorkUnit(SubTask execUnit) {
WorkUnit wu = new WorkUnit(this, execUnit);
workUnits.add(wu);
return wu;
}
|
class class_name[name] begin[{]
method[createWorkUnit, return_type[type[WorkUnit]], modifier[public], parameter[execUnit]] begin[{]
local_variable[type[WorkUnit], wu]
call[workUnits.add, parameter[member[.wu]]]
return[member[.wu]]
end[}]
END[}]
|
Keyword[public] identifier[WorkUnit] identifier[createWorkUnit] operator[SEP] identifier[SubTask] identifier[execUnit] operator[SEP] {
identifier[WorkUnit] identifier[wu] operator[=] Keyword[new] identifier[WorkUnit] operator[SEP] Keyword[this] , identifier[execUnit] operator[SEP] operator[SEP] identifier[workUnits] operator[SEP] identifier[add] operator[SEP] identifier[wu] operator[SEP] operator[SEP] Keyword[return] identifier[wu] operator[SEP]
}
|
public T parse(
CharSequence text,
ParseLog status
) {
int start = status.getPosition();
for (int i = 0; i < this.parsers.length; i++) {
status.reset(); // initialization
status.setPosition(start);
// use the default global attributes of every single parser
T parsed = this.parsers[i].parse(text, status);
if ((parsed != null) && !status.isError()) {
return parsed;
}
}
status.setError(status.getErrorIndex(), "Not matched by any format: " + text);
return null;
}
|
class class_name[name] begin[{]
method[parse, return_type[type[T]], modifier[public], parameter[text, status]] begin[{]
local_variable[type[int], start]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=status, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setPosition, postfix_operators=[], prefix_operators=[], qualifier=status, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=parsers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=parsed)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=parsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isError, postfix_operators=[], prefix_operators=['!'], qualifier=status, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=parsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=parsers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=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)
call[status.setError, parameter[call[status.getErrorIndex, parameter[]], binary_operation[literal["Not matched by any format: "], +, member[.text]]]]
return[literal[null]]
end[}]
END[}]
|
Keyword[public] identifier[T] identifier[parse] operator[SEP] identifier[CharSequence] identifier[text] , identifier[ParseLog] identifier[status] operator[SEP] {
Keyword[int] identifier[start] operator[=] identifier[status] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[parsers] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[status] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[status] operator[SEP] identifier[setPosition] operator[SEP] identifier[start] operator[SEP] operator[SEP] identifier[T] identifier[parsed] operator[=] Keyword[this] operator[SEP] identifier[parsers] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[text] , identifier[status] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[parsed] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[status] operator[SEP] identifier[isError] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[parsed] operator[SEP]
}
}
identifier[status] operator[SEP] identifier[setError] operator[SEP] identifier[status] operator[SEP] identifier[getErrorIndex] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[text] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
private Object syncPutIntoBucket(FastSyncHashBucket hb, FastSyncHashEntry newEntry) {
FastSyncHashEntry e = null;
FastSyncHashEntry last = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "syncPutIntoBucket");
}
synchronized (hb) {
e = hb.root;
// already in there?
while (e != null) {
if (e.key == newEntry.key) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "syncPutIntoBucket: key/hash pair is already in the bucket");
}
return e.value;
}
last = e;
e = e.next;
}
if (last == null) {
if (hb.root == null) {
// this is root
hb.root = newEntry;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "syncPutIntoBucket: Adding new entry at the beginning (root)");
}
return newEntry.value;
}
last = hb.root;
while (last.next != null) {
last = last.next;
}
}
last.next = newEntry;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "syncPutIntoBucket: Adding new entry at the end");
}
return newEntry.value;
} // end-sync
}
|
class class_name[name] begin[{]
method[syncPutIntoBucket, return_type[type[Object]], modifier[private], parameter[hb, newEntry]] begin[{]
local_variable[type[FastSyncHashEntry], e]
local_variable[type[FastSyncHashEntry], last]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.entry, parameter[member[.tc], literal["syncPutIntoBucket"]]]
else begin[{]
None
end[}]
SYNCHRONIZED[member[.hb]] BEGIN[{]
assign[member[.e], member[hb.root]]
while[binary_operation[member[.e], !=, literal[null]]] begin[{]
if[binary_operation[member[e.key], ==, member[newEntry.key]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["syncPutIntoBucket: key/hash pair is already in the bucket"]]]
else begin[{]
None
end[}]
return[member[e.value]]
else begin[{]
None
end[}]
assign[member[.last], member[.e]]
assign[member[.e], member[e.next]]
end[}]
if[binary_operation[member[.last], ==, literal[null]]] begin[{]
if[binary_operation[member[hb.root], ==, literal[null]]] begin[{]
assign[member[hb.root], member[.newEntry]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["syncPutIntoBucket: Adding new entry at the beginning (root)"]]]
else begin[{]
None
end[}]
return[member[newEntry.value]]
else begin[{]
None
end[}]
assign[member[.last], member[hb.root]]
while[binary_operation[member[last.next], !=, literal[null]]] begin[{]
assign[member[.last], member[last.next]]
end[}]
else begin[{]
None
end[}]
assign[member[last.next], member[.newEntry]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["syncPutIntoBucket: Adding new entry at the end"]]]
else begin[{]
None
end[}]
return[member[newEntry.value]]
END[}]
end[}]
END[}]
|
Keyword[private] identifier[Object] identifier[syncPutIntoBucket] operator[SEP] identifier[FastSyncHashBucket] identifier[hb] , identifier[FastSyncHashEntry] identifier[newEntry] operator[SEP] {
identifier[FastSyncHashEntry] identifier[e] operator[=] Other[null] operator[SEP] identifier[FastSyncHashEntry] identifier[last] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[hb] operator[SEP] {
identifier[e] operator[=] identifier[hb] operator[SEP] identifier[root] operator[SEP] Keyword[while] operator[SEP] identifier[e] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[key] operator[==] identifier[newEntry] operator[SEP] identifier[key] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[e] operator[SEP] identifier[value] operator[SEP]
}
identifier[last] operator[=] identifier[e] operator[SEP] identifier[e] operator[=] identifier[e] operator[SEP] identifier[next] operator[SEP]
}
Keyword[if] operator[SEP] identifier[last] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[hb] operator[SEP] identifier[root] operator[==] Other[null] operator[SEP] {
identifier[hb] operator[SEP] identifier[root] operator[=] identifier[newEntry] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[newEntry] operator[SEP] identifier[value] operator[SEP]
}
identifier[last] operator[=] identifier[hb] operator[SEP] identifier[root] operator[SEP] Keyword[while] operator[SEP] identifier[last] operator[SEP] identifier[next] operator[!=] Other[null] operator[SEP] {
identifier[last] operator[=] identifier[last] operator[SEP] identifier[next] operator[SEP]
}
}
identifier[last] operator[SEP] identifier[next] operator[=] identifier[newEntry] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[newEntry] operator[SEP] identifier[value] operator[SEP]
}
}
|
public int prepare() throws ProtocolException, RollbackException, SeverePersistenceException, TransactionException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "prepare");
// Check the current transaction state (use state lock to ensure we see the latest value)
synchronized (_stateLock)
{
if (_state != TransactionState.STATE_ACTIVE)
{
ProtocolException pe = new ProtocolException("TRAN_PROTOCOL_ERROR_SIMS1001", new Object[]{});
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot prepare Transaction. Transaction is complete or completing!", pe);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare");
throw pe;
}
// Transition our prepare sub-state immediately - before we call the callbacks
_preCommitSubstate = TransactionState.STATE_PREPARING;
}
// PK81848
// From this point on, we must perform a rollback if we fail to complete the prepare,
// or another thread requests a deferred rollback
try
{
// Call beforeCompletion on MP callback
for (int i = 0; i < _callbacks.size(); i++)
{
TransactionCallback callback = (TransactionCallback) _callbacks.get(i);
callback.beforeCompletion(this);
}
// Do we have work to do?
if (_workList != null)
{
_workList.preCommit(this);
synchronized (_stateLock)
{
// Need to change the overalll state after we have
// called the callbacks and preCommitted
// the workList as they may trigger
// an addWork call to add work to the
// transaction.
_state = TransactionState.STATE_PREPARING;
}
// The transaction is about to be in a state where any rollback must
// update the database. We cannot narrow the window any more than this
_rollbackChanges = true;
// Perform the prepare
_persistence.prepare(this);
// State check/change must be performed holding the state lock
synchronized (_stateLock)
{
// Another thread may have have received a rollback, while we were
// performing our prepare - if the database was extremely slow to respond
if (_preCommitSubstate == TransactionState.STATE_ROLLBACK_DEFERRED)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.event(this, tc, "Deferred rollback requested during prepare for TranId: "+_ptid);
// Throw an exception to trigger rollback processing.
throw new DeferredRollbackException();
}
else
{
_state = _preCommitSubstate = TransactionState.STATE_PREPARED;
}
}
}
else
{
// State change must be performed holding the state lock
synchronized (_stateLock)
{
// Defect 301480
// We don't have any work in our workList so in theory we should be
// able to vote READ_ONLY at this point. However in a particular case
// (Best Effort message being sent off server) a call back in an empty
// XAResource is used to trigger work on a remote server. In this case
// we need beforeCompletion AND afterCompletion to be called at the
// CORRECT time during transaction completion to ensure that the off
// server work stays part of the XA transaction and gets informed of
// the correct completion direction.
_state = _preCommitSubstate = TransactionState.STATE_PREPARED;
}
}
}
catch (SeverePersistenceException spe)
{
// SPE exceptions are handled with an RMFAIL return code by the caller,
// so unlike all other types of exception no attempt is made here to
// rollback the transaction. However, we report a local error - so
// the whole JVM will be coming down with a few minutes.
com.ibm.ws.ffdc.FFDCFilter.processException(spe, "com.ibm.ws.sib.msgstore.transactions.XidParticipant.prepare", "1:420:1.73", this);
// As we have thrown a severe exception we need to inform
// the ME that this instance is no longer able to continue.
if (_ms != null)
{
_ms.reportLocalError();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unrecoverable persistence exception caught during prepare phase of transaction!", spe);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare", spe);
throw spe;
}
// Catch and handle all exceptions but allow
// Errors to filter up without interference
catch (Exception e)
{
com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.transactions.XidParticipant.prepare", "1:436:1.73", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Transaction will roll-back due to Exception in prepare!", e);
// Update our prepare state before calling rollback. If we are responding
// to a deferred rollback request this will have no affect but if this is
// due to some other failure it will lock out any other attempts to rollback
synchronized (_stateLock)
{
_preCommitSubstate = TransactionState.STATE_ROLLINGBACK;
}
// An error has occurred but we are able to keep the ME
// going so we just need to clean up this transaction.
try
{
// When we throw our RollbackException the TM is
// going to assume we are complete so we need to
// ensure we are rolled-back.
//
// PK81848.2
// We need to pass "true" in order to turn off the
// state checking which should block other threads
// from attempting a rollback when we are in the
// middle of internal rollback processing.
rollback(true);
}
// Catch and handle all exceptions but allow
// Errors to filter up without interference
catch (Exception e2)
{
com.ibm.ws.ffdc.FFDCFilter.processException(e2, "com.ibm.ws.sib.msgstore.transactions.XIDParticipant.prepare", "1:466:1.73", this);
// This is a problem because we now must RMFAIL this prepare call as we do not know the outcome.
// Transition to rollback expected state now even if we are in deferred rollback. This is the
// only thing we can do (problem is we said XA_OK to roll back in deferred case and now we
// cannot honour it). This case may still leave indoubts.
synchronized(_stateLock)
{
_state = _preCommitSubstate = TransactionState.STATE_ROLLBACK_EXPECTED;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare", "Exception caught rolling-back transaction after preCommit failure! " + e2);
throw new TransactionException(e2);
}
// Mark ourselves as complete, regardless of the outcome of the attempt to rollback.
synchronized (_stateLock)
{
_state = _preCommitSubstate = TransactionState.STATE_ROLLEDBACK;
}
// Wrap any persistence exception, or an unexpected exception, in a rollback exception.
// This informs the TM that they can forget about this transaction.
RollbackException re = new RollbackException("COMPLETION_EXCEPTION_SIMS1002", new Object[]{e}, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare", re);
throw re;
}
// Non-exception return path always returns XA_OK
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare", "return="+XAResource.XA_OK);
return XAResource.XA_OK;
}
|
class class_name[name] begin[{]
method[prepare, return_type[type[int]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["prepare"]]]
else begin[{]
None
end[}]
SYNCHRONIZED[member[._stateLock]] BEGIN[{]
if[binary_operation[member[._state], !=, member[TransactionState.STATE_ACTIVE]]] begin[{]
local_variable[type[ProtocolException], pe]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{]
call[SibTr.event, parameter[THIS[], member[.tc], literal["Cannot prepare Transaction. Transaction is complete or completing!"], member[.pe]]]
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["prepare"]]]
else begin[{]
None
end[}]
ThrowStatement(expression=MemberReference(member=pe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
assign[member[._preCommitSubstate], member[TransactionState.STATE_PREPARING]]
END[}]
TryStatement(block=[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=get, postfix_operators=[], prefix_operators=[], qualifier=_callbacks, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=TransactionCallback, sub_type=None)), name=callback)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransactionCallback, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=beforeCompletion, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_callbacks, 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), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_workList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[SynchronizedStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Assignment(expressionl=MemberReference(member=_preCommitSubstate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STATE_PREPARED, postfix_operators=[], prefix_operators=[], qualifier=TransactionState, selectors=[]))), label=None)], label=None, lock=MemberReference(member=_stateLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=preCommit, postfix_operators=[], prefix_operators=[], qualifier=_workList, selectors=[], type_arguments=None), label=None), SynchronizedStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STATE_PREPARING, postfix_operators=[], prefix_operators=[], qualifier=TransactionState, selectors=[])), label=None)], label=None, lock=MemberReference(member=_stateLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_rollbackChanges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=prepare, postfix_operators=[], prefix_operators=[], qualifier=_persistence, selectors=[], type_arguments=None), label=None), SynchronizedStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_preCommitSubstate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=STATE_ROLLBACK_DEFERRED, postfix_operators=[], prefix_operators=[], qualifier=TransactionState, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Assignment(expressionl=MemberReference(member=_preCommitSubstate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STATE_PREPARED, postfix_operators=[], prefix_operators=[], qualifier=TransactionState, selectors=[]))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Deferred rollback requested during prepare for TranId: "), operandr=MemberReference(member=_ptid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=event, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DeferredRollbackException, sub_type=None)), label=None)]))], label=None, lock=MemberReference(member=_stateLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=spe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.msgstore.transactions.XidParticipant.prepare"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:420:1.73"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ffdc.FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_ms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=reportLocalError, postfix_operators=[], prefix_operators=[], qualifier=_ms, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecoverable persistence exception caught during prepare phase of transaction!"), MemberReference(member=spe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=event, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="prepare"), MemberReference(member=spe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=spe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=spe, types=['SeverePersistenceException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.msgstore.transactions.XidParticipant.prepare"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:436:1.73"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ffdc.FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Transaction will roll-back due to Exception in prepare!"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=event, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), SynchronizedStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_preCommitSubstate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STATE_ROLLINGBACK, postfix_operators=[], prefix_operators=[], qualifier=TransactionState, selectors=[])), label=None)], label=None, lock=MemberReference(member=_stateLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=rollback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.msgstore.transactions.XIDParticipant.prepare"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:466:1.73"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ffdc.FFDCFilter, selectors=[], type_arguments=None), label=None), SynchronizedStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Assignment(expressionl=MemberReference(member=_preCommitSubstate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STATE_ROLLBACK_EXPECTED, postfix_operators=[], prefix_operators=[], qualifier=TransactionState, selectors=[]))), label=None)], label=None, lock=MemberReference(member=_stateLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="prepare"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception caught rolling-back transaction after preCommit failure! "), operandr=MemberReference(member=e2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e2, 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=TransactionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e2, types=['Exception']))], finally_block=None, label=None, resources=None), SynchronizedStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Assignment(expressionl=MemberReference(member=_preCommitSubstate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STATE_ROLLEDBACK, postfix_operators=[], prefix_operators=[], qualifier=TransactionState, selectors=[]))), label=None)], label=None, lock=MemberReference(member=_stateLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="COMPLETION_EXCEPTION_SIMS1002"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=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=RollbackException, sub_type=None)), name=re)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RollbackException, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="prepare"), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["prepare"], binary_operation[literal["return="], +, member[XAResource.XA_OK]]]]
else begin[{]
None
end[}]
return[member[XAResource.XA_OK]]
end[}]
END[}]
|
Keyword[public] Keyword[int] identifier[prepare] operator[SEP] operator[SEP] Keyword[throws] identifier[ProtocolException] , identifier[RollbackException] , identifier[SeverePersistenceException] , identifier[TransactionException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[_stateLock] operator[SEP] {
Keyword[if] operator[SEP] identifier[_state] operator[!=] identifier[TransactionState] operator[SEP] identifier[STATE_ACTIVE] operator[SEP] {
identifier[ProtocolException] identifier[pe] operator[=] Keyword[new] identifier[ProtocolException] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] 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[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[event] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[pe] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[throw] identifier[pe] operator[SEP]
}
identifier[_preCommitSubstate] operator[=] identifier[TransactionState] operator[SEP] identifier[STATE_PREPARING] operator[SEP]
}
Keyword[try] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_callbacks] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[TransactionCallback] identifier[callback] operator[=] operator[SEP] identifier[TransactionCallback] operator[SEP] identifier[_callbacks] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[callback] operator[SEP] identifier[beforeCompletion] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[_workList] operator[!=] Other[null] operator[SEP] {
identifier[_workList] operator[SEP] identifier[preCommit] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[_stateLock] operator[SEP] {
identifier[_state] operator[=] identifier[TransactionState] operator[SEP] identifier[STATE_PREPARING] operator[SEP]
}
identifier[_rollbackChanges] operator[=] literal[boolean] operator[SEP] identifier[_persistence] operator[SEP] identifier[prepare] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[_stateLock] operator[SEP] {
Keyword[if] operator[SEP] identifier[_preCommitSubstate] operator[==] identifier[TransactionState] operator[SEP] identifier[STATE_ROLLBACK_DEFERRED] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[event] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[_ptid] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DeferredRollbackException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[_state] operator[=] identifier[_preCommitSubstate] operator[=] identifier[TransactionState] operator[SEP] identifier[STATE_PREPARED] operator[SEP]
}
}
}
Keyword[else] {
Keyword[synchronized] operator[SEP] identifier[_stateLock] operator[SEP] {
identifier[_state] operator[=] identifier[_preCommitSubstate] operator[=] identifier[TransactionState] operator[SEP] identifier[STATE_PREPARED] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[SeverePersistenceException] identifier[spe] operator[SEP] {
identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ffdc] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[spe] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_ms] operator[!=] Other[null] operator[SEP] {
identifier[_ms] operator[SEP] identifier[reportLocalError] 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[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[event] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[spe] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[spe] operator[SEP] operator[SEP] Keyword[throw] identifier[spe] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ffdc] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[event] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[_stateLock] operator[SEP] {
identifier[_preCommitSubstate] operator[=] identifier[TransactionState] operator[SEP] identifier[STATE_ROLLINGBACK] operator[SEP]
}
Keyword[try] {
identifier[rollback] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e2] operator[SEP] {
identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ffdc] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e2] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[_stateLock] operator[SEP] {
identifier[_state] operator[=] identifier[_preCommitSubstate] operator[=] identifier[TransactionState] operator[SEP] identifier[STATE_ROLLBACK_EXPECTED] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , literal[String] operator[+] identifier[e2] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[TransactionException] operator[SEP] identifier[e2] operator[SEP] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[_stateLock] operator[SEP] {
identifier[_state] operator[=] identifier[_preCommitSubstate] operator[=] identifier[TransactionState] operator[SEP] identifier[STATE_ROLLEDBACK] operator[SEP]
}
identifier[RollbackException] identifier[re] operator[=] Keyword[new] identifier[RollbackException] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[e]
} , identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[re] operator[SEP] operator[SEP] Keyword[throw] identifier[re] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , literal[String] operator[+] identifier[XAResource] operator[SEP] identifier[XA_OK] operator[SEP] operator[SEP] Keyword[return] identifier[XAResource] operator[SEP] identifier[XA_OK] operator[SEP]
}
|
public StreamPlan transferRanges(InetAddress to, InetAddress connecting, String keyspace, Collection<Range<Token>> ranges, String... columnFamilies)
{
StreamSession session = coordinator.getOrCreateNextSession(to, connecting);
session.addTransferRanges(keyspace, ranges, Arrays.asList(columnFamilies), flushBeforeTransfer, repairedAt);
return this;
}
|
class class_name[name] begin[{]
method[transferRanges, return_type[type[StreamPlan]], modifier[public], parameter[to, connecting, keyspace, ranges, columnFamilies]] begin[{]
local_variable[type[StreamSession], session]
call[session.addTransferRanges, parameter[member[.keyspace], member[.ranges], call[Arrays.asList, parameter[member[.columnFamilies]]], member[.flushBeforeTransfer], member[.repairedAt]]]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[StreamPlan] identifier[transferRanges] operator[SEP] identifier[InetAddress] identifier[to] , identifier[InetAddress] identifier[connecting] , identifier[String] identifier[keyspace] , identifier[Collection] operator[<] identifier[Range] operator[<] identifier[Token] operator[>] operator[>] identifier[ranges] , identifier[String] operator[...] identifier[columnFamilies] operator[SEP] {
identifier[StreamSession] identifier[session] operator[=] identifier[coordinator] operator[SEP] identifier[getOrCreateNextSession] operator[SEP] identifier[to] , identifier[connecting] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[addTransferRanges] operator[SEP] identifier[keyspace] , identifier[ranges] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[columnFamilies] operator[SEP] , identifier[flushBeforeTransfer] , identifier[repairedAt] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public S findScript(String name) throws E {
if (MetaClass.NO_CACHE)
return loadScript(name);
else
return scripts.getUnchecked(name).get();
}
|
class class_name[name] begin[{]
method[findScript, return_type[type[S]], modifier[public], parameter[name]] begin[{]
if[member[MetaClass.NO_CACHE]] begin[{]
return[call[.loadScript, parameter[member[.name]]]]
else begin[{]
return[call[scripts.getUnchecked, parameter[member[.name]]]]
end[}]
end[}]
END[}]
|
Keyword[public] identifier[S] identifier[findScript] operator[SEP] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[E] {
Keyword[if] operator[SEP] identifier[MetaClass] operator[SEP] identifier[NO_CACHE] operator[SEP] Keyword[return] identifier[loadScript] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[scripts] operator[SEP] identifier[getUnchecked] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
|
public void markAsVisited(final Field field) {
final OneOf oneOfAnnotation = field.getAnnotation(OneOf.class);
if (oneOfAnnotation != null) {
final OneOfGroup oneOfGroup = this.mapping.get(oneOfAnnotation.value());
oneOfGroup.satisfiedBy.add(new OneOfSatisfier(field, false));
}
final CanSatisfyOneOf canSatisfyOneOf = field.getAnnotation(CanSatisfyOneOf.class);
if (canSatisfyOneOf != null) {
final OneOfGroup oneOfGroup = this.mapping.get(canSatisfyOneOf.value());
oneOfGroup.satisfiedBy.add(new OneOfSatisfier(field, true));
}
}
|
class class_name[name] begin[{]
method[markAsVisited, return_type[void], modifier[public], parameter[field]] begin[{]
local_variable[type[OneOf], oneOfAnnotation]
if[binary_operation[member[.oneOfAnnotation], !=, literal[null]]] begin[{]
local_variable[type[OneOfGroup], oneOfGroup]
call[oneOfGroup.satisfiedBy.add, parameter[ClassCreator(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OneOfSatisfier, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[CanSatisfyOneOf], canSatisfyOneOf]
if[binary_operation[member[.canSatisfyOneOf], !=, literal[null]]] begin[{]
local_variable[type[OneOfGroup], oneOfGroup]
call[oneOfGroup.satisfiedBy.add, parameter[ClassCreator(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OneOfSatisfier, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[markAsVisited] operator[SEP] Keyword[final] identifier[Field] identifier[field] operator[SEP] {
Keyword[final] identifier[OneOf] identifier[oneOfAnnotation] operator[=] identifier[field] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[OneOf] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oneOfAnnotation] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[OneOfGroup] identifier[oneOfGroup] operator[=] Keyword[this] operator[SEP] identifier[mapping] operator[SEP] identifier[get] operator[SEP] identifier[oneOfAnnotation] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[oneOfGroup] operator[SEP] identifier[satisfiedBy] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[OneOfSatisfier] operator[SEP] identifier[field] , literal[boolean] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[CanSatisfyOneOf] identifier[canSatisfyOneOf] operator[=] identifier[field] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[CanSatisfyOneOf] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[canSatisfyOneOf] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[OneOfGroup] identifier[oneOfGroup] operator[=] Keyword[this] operator[SEP] identifier[mapping] operator[SEP] identifier[get] operator[SEP] identifier[canSatisfyOneOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[oneOfGroup] operator[SEP] identifier[satisfiedBy] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[OneOfSatisfier] operator[SEP] identifier[field] , literal[boolean] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static <T extends Extendable> List<T> group(final List<T> values, final Group[] groups) {
final SortableList<T> list = getSortableList(values);
final GroupStrategy strategy = new GroupStrategy();
for (int i = groups.length - 1; i >= 0; i--) {
list.sortOnProperty(groups[i], true, strategy);
}
return list;
}
|
class class_name[name] begin[{]
method[group, return_type[type[List]], modifier[public static], parameter[values, groups]] begin[{]
local_variable[type[SortableList], list]
local_variable[type[GroupStrategy], strategy]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=groups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=strategy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sortOnProperty, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=groups, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.list]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Extendable] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[group] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[T] operator[>] identifier[values] , Keyword[final] identifier[Group] operator[SEP] operator[SEP] identifier[groups] operator[SEP] {
Keyword[final] identifier[SortableList] operator[<] identifier[T] operator[>] identifier[list] operator[=] identifier[getSortableList] operator[SEP] identifier[values] operator[SEP] operator[SEP] Keyword[final] identifier[GroupStrategy] identifier[strategy] operator[=] Keyword[new] identifier[GroupStrategy] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[groups] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] {
identifier[list] operator[SEP] identifier[sortOnProperty] operator[SEP] identifier[groups] operator[SEP] identifier[i] operator[SEP] , literal[boolean] , identifier[strategy] operator[SEP] operator[SEP]
}
Keyword[return] identifier[list] operator[SEP]
}
|
private String destroyAs(String[] args) throws Exception {
if (args.length < 4) {
return M3UAOAMMessages.INVALID_COMMAND;
}
String asName = args[3];
if (asName == null) {
return M3UAOAMMessages.INVALID_COMMAND;
}
String m3uaStackName = null;
if (args.length > 4) {
if (!args[4].equals("stackname")) {
return M3UAOAMMessages.INVALID_COMMAND;
}
m3uaStackName = args[5];
M3UAManagementImpl m3uaManagementtmp = this.m3uaManagements.get(m3uaStackName);
if (m3uaManagementtmp == null) {
return String.format(M3UAOAMMessages.NO_M3UA_MANAGEMENT_BEAN_FOR_NAME, m3uaStackName);
}
this.m3uaManagement = m3uaManagementtmp;
} else {
this.setDefaultValue();
}
AsImpl asImpl = this.m3uaManagement.destroyAs(asName);
return String.format(M3UAOAMMessages.DESTROY_AS_SUCESSFULL, asName, this.m3uaManagement.getName());
}
|
class class_name[name] begin[{]
method[destroyAs, return_type[type[String]], modifier[private], parameter[args]] begin[{]
if[binary_operation[member[args.length], <, literal[4]]] begin[{]
return[member[M3UAOAMMessages.INVALID_COMMAND]]
else begin[{]
None
end[}]
local_variable[type[String], asName]
if[binary_operation[member[.asName], ==, literal[null]]] begin[{]
return[member[M3UAOAMMessages.INVALID_COMMAND]]
else begin[{]
None
end[}]
local_variable[type[String], m3uaStackName]
if[binary_operation[member[args.length], >, literal[4]]] begin[{]
if[member[.args]] begin[{]
return[member[M3UAOAMMessages.INVALID_COMMAND]]
else begin[{]
None
end[}]
assign[member[.m3uaStackName], member[.args]]
local_variable[type[M3UAManagementImpl], m3uaManagementtmp]
if[binary_operation[member[.m3uaManagementtmp], ==, literal[null]]] begin[{]
return[call[String.format, parameter[member[M3UAOAMMessages.NO_M3UA_MANAGEMENT_BEAN_FOR_NAME], member[.m3uaStackName]]]]
else begin[{]
None
end[}]
assign[THIS[member[None.m3uaManagement]], member[.m3uaManagementtmp]]
else begin[{]
THIS[call[None.setDefaultValue, parameter[]]]
end[}]
local_variable[type[AsImpl], asImpl]
return[call[String.format, parameter[member[M3UAOAMMessages.DESTROY_AS_SUCESSFULL], member[.asName], THIS[member[None.m3uaManagement]call[None.getName, parameter[]]]]]]
end[}]
END[}]
|
Keyword[private] identifier[String] identifier[destroyAs] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[<] Other[4] operator[SEP] {
Keyword[return] identifier[M3UAOAMMessages] operator[SEP] identifier[INVALID_COMMAND] operator[SEP]
}
identifier[String] identifier[asName] operator[=] identifier[args] operator[SEP] Other[3] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[asName] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[M3UAOAMMessages] operator[SEP] identifier[INVALID_COMMAND] operator[SEP]
}
identifier[String] identifier[m3uaStackName] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[>] Other[4] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[args] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] identifier[M3UAOAMMessages] operator[SEP] identifier[INVALID_COMMAND] operator[SEP]
}
identifier[m3uaStackName] operator[=] identifier[args] operator[SEP] Other[5] operator[SEP] operator[SEP] identifier[M3UAManagementImpl] identifier[m3uaManagementtmp] operator[=] Keyword[this] operator[SEP] identifier[m3uaManagements] operator[SEP] identifier[get] operator[SEP] identifier[m3uaStackName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m3uaManagementtmp] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[M3UAOAMMessages] operator[SEP] identifier[NO_M3UA_MANAGEMENT_BEAN_FOR_NAME] , identifier[m3uaStackName] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[m3uaManagement] operator[=] identifier[m3uaManagementtmp] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[setDefaultValue] operator[SEP] operator[SEP] operator[SEP]
}
identifier[AsImpl] identifier[asImpl] operator[=] Keyword[this] operator[SEP] identifier[m3uaManagement] operator[SEP] identifier[destroyAs] operator[SEP] identifier[asName] operator[SEP] operator[SEP] Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[M3UAOAMMessages] operator[SEP] identifier[DESTROY_AS_SUCESSFULL] , identifier[asName] , Keyword[this] operator[SEP] identifier[m3uaManagement] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Object encode(Object object) throws EncoderException {
try {
byte[] byteArray = object instanceof String ? ((String) object).getBytes() : (byte[]) object;
return encodeHex(byteArray);
} catch (ClassCastException e) {
throw new EncoderException(e.getMessage());
}
}
|
class class_name[name] begin[{]
method[encode, return_type[type[Object]], modifier[public], parameter[object]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), if_false=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=byte)), if_true=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), name=byteArray)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=byteArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encodeHex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EncoderException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassCastException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] identifier[Object] identifier[encode] operator[SEP] identifier[Object] identifier[object] operator[SEP] Keyword[throws] identifier[EncoderException] {
Keyword[try] {
Keyword[byte] operator[SEP] operator[SEP] identifier[byteArray] operator[=] identifier[object] Keyword[instanceof] identifier[String] operator[?] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[:] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[object] operator[SEP] Keyword[return] identifier[encodeHex] operator[SEP] identifier[byteArray] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[EncoderException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public ConstantField createConstantField(Class<?> container, String field, Constant annot)
throws ConstantException {
Class<?> type;
try {
type = container.getField(field).getType();
} catch (NoSuchFieldException e) {
throw new ConstantException("Cannot find constant " + annot.name()
+ " (" + container.getSimpleName() + "." + field + ")", e);
}
for (ConstantFieldProvider provider : providers) {
if (provider.canProvide(type))
return provider.getField(type, container, field, annot);
}
throw new ConstantException("No provider found for " + annot.name()
+ " of type " + type.getSimpleName());
}
|
class class_name[name] begin[{]
method[createConstantField, return_type[type[ConstantField]], modifier[public], parameter[container, field, annot]] begin[{]
local_variable[type[Class], type]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[MethodInvocation(arguments=[], member=getType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot find constant "), operandr=MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=annot, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ("), operator=+), operandr=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), 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=ConstantException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchFieldException']))], finally_block=None, label=None, resources=None)
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=canProvide, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=providers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=provider)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConstantFieldProvider, sub_type=None))), label=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No provider found for "), operandr=MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=annot, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" of type "), operator=+), operandr=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConstantException, sub_type=None)), label=None)
end[}]
END[}]
|
Keyword[public] identifier[ConstantField] identifier[createConstantField] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[container] , identifier[String] identifier[field] , identifier[Constant] identifier[annot] operator[SEP] Keyword[throws] identifier[ConstantException] {
identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[SEP] Keyword[try] {
identifier[type] operator[=] identifier[container] operator[SEP] identifier[getField] operator[SEP] identifier[field] operator[SEP] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchFieldException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ConstantException] operator[SEP] literal[String] operator[+] identifier[annot] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[container] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[field] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[ConstantFieldProvider] identifier[provider] operator[:] identifier[providers] operator[SEP] {
Keyword[if] operator[SEP] identifier[provider] operator[SEP] identifier[canProvide] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[provider] operator[SEP] identifier[getField] operator[SEP] identifier[type] , identifier[container] , identifier[field] , identifier[annot] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[ConstantException] operator[SEP] literal[String] operator[+] identifier[annot] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[type] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private int findIndexOfFrom(String query) {
if (query.startsWith("from")) return 0;
int fromIdx = query.indexOf(" from ");
if (-1 == fromIdx) return -1;
final int first = query.substring(0, fromIdx).indexOf("(");
if (first > 0) {
int leftCnt = 1;
int i = first + 1;
while (leftCnt != 0 && i < query.length()) {
if (query.charAt(i) == '(') leftCnt++;
else if (query.charAt(i) == ')') leftCnt--;
i++;
}
if (leftCnt > 0) return -1;
else {
fromIdx = query.indexOf(" from ", i);
return (fromIdx == -1) ? -1 : fromIdx + 1;
}
} else {
return fromIdx + 1;
}
}
|
class class_name[name] begin[{]
method[findIndexOfFrom, return_type[type[int]], modifier[private], parameter[query]] begin[{]
if[call[query.startsWith, parameter[literal["from"]]]] begin[{]
return[literal[0]]
else begin[{]
None
end[}]
local_variable[type[int], fromIdx]
if[binary_operation[literal[1], ==, member[.fromIdx]]] begin[{]
return[literal[1]]
else begin[{]
None
end[}]
local_variable[type[int], first]
if[binary_operation[member[.first], >, literal[0]]] begin[{]
local_variable[type[int], leftCnt]
local_variable[type[int], i]
while[binary_operation[binary_operation[member[.leftCnt], !=, literal[0]], &&, binary_operation[member[.i], <, call[query.length, parameter[]]]]] begin[{]
if[binary_operation[call[query.charAt, parameter[member[.i]]], ==, literal['(']]] begin[{]
member[.leftCnt]
else begin[{]
if[binary_operation[call[query.charAt, parameter[member[.i]]], ==, literal[')']]] begin[{]
member[.leftCnt]
else begin[{]
None
end[}]
end[}]
member[.i]
end[}]
if[binary_operation[member[.leftCnt], >, literal[0]]] begin[{]
return[literal[1]]
else begin[{]
assign[member[.fromIdx], call[query.indexOf, parameter[literal[" from "], member[.i]]]]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=fromIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), if_false=BinaryOperation(operandl=MemberReference(member=fromIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1))]
end[}]
else begin[{]
return[binary_operation[member[.fromIdx], +, literal[1]]]
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[int] identifier[findIndexOfFrom] operator[SEP] identifier[String] identifier[query] operator[SEP] {
Keyword[if] operator[SEP] identifier[query] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[int] identifier[fromIdx] operator[=] identifier[query] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[-] Other[1] operator[==] identifier[fromIdx] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[final] Keyword[int] identifier[first] operator[=] identifier[query] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[fromIdx] operator[SEP] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[first] operator[>] Other[0] operator[SEP] {
Keyword[int] identifier[leftCnt] operator[=] Other[1] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[first] operator[+] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[leftCnt] operator[!=] Other[0] operator[&&] identifier[i] operator[<] identifier[query] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[query] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[SEP] identifier[leftCnt] operator[++] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[query] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[SEP] identifier[leftCnt] operator[--] operator[SEP] identifier[i] operator[++] operator[SEP]
}
Keyword[if] operator[SEP] identifier[leftCnt] operator[>] Other[0] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[else] {
identifier[fromIdx] operator[=] identifier[query] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[i] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[fromIdx] operator[==] operator[-] Other[1] operator[SEP] operator[?] operator[-] Other[1] operator[:] identifier[fromIdx] operator[+] Other[1] operator[SEP]
}
}
Keyword[else] {
Keyword[return] identifier[fromIdx] operator[+] Other[1] operator[SEP]
}
}
|
public Observable<WorkflowRunActionRepetitionDefinitionCollectionInner> listAsync(String resourceGroupName, String workflowName, String runName, String actionName) {
return listWithServiceResponseAsync(resourceGroupName, workflowName, runName, actionName).map(new Func1<ServiceResponse<WorkflowRunActionRepetitionDefinitionCollectionInner>, WorkflowRunActionRepetitionDefinitionCollectionInner>() {
@Override
public WorkflowRunActionRepetitionDefinitionCollectionInner call(ServiceResponse<WorkflowRunActionRepetitionDefinitionCollectionInner> response) {
return response.body();
}
});
}
|
class class_name[name] begin[{]
method[listAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, workflowName, runName, actionName]] begin[{]
return[call[.listWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.workflowName], member[.runName], member[.actionName]]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[WorkflowRunActionRepetitionDefinitionCollectionInner] operator[>] identifier[listAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[workflowName] , identifier[String] identifier[runName] , identifier[String] identifier[actionName] operator[SEP] {
Keyword[return] identifier[listWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[workflowName] , identifier[runName] , identifier[actionName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[WorkflowRunActionRepetitionDefinitionCollectionInner] operator[>] , identifier[WorkflowRunActionRepetitionDefinitionCollectionInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[WorkflowRunActionRepetitionDefinitionCollectionInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[WorkflowRunActionRepetitionDefinitionCollectionInner] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public static List<CommercePriceList> findByCommerceCurrencyId(
long commerceCurrencyId, int start, int end,
OrderByComparator<CommercePriceList> orderByComparator) {
return getPersistence()
.findByCommerceCurrencyId(commerceCurrencyId, start, end,
orderByComparator);
}
|
class class_name[name] begin[{]
method[findByCommerceCurrencyId, return_type[type[List]], modifier[public static], parameter[commerceCurrencyId, start, end, orderByComparator]] begin[{]
return[call[.getPersistence, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[CommercePriceList] operator[>] identifier[findByCommerceCurrencyId] operator[SEP] Keyword[long] identifier[commerceCurrencyId] , Keyword[int] identifier[start] , Keyword[int] identifier[end] , identifier[OrderByComparator] operator[<] identifier[CommercePriceList] operator[>] identifier[orderByComparator] operator[SEP] {
Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByCommerceCurrencyId] operator[SEP] identifier[commerceCurrencyId] , identifier[start] , identifier[end] , identifier[orderByComparator] operator[SEP] operator[SEP]
}
|
@Override
public Object set(int index, Object obj) {
State state = isState(obj);
return set(index, obj, state);
}
|
class class_name[name] begin[{]
method[set, return_type[type[Object]], modifier[public], parameter[index, obj]] begin[{]
local_variable[type[State], state]
return[call[.set, parameter[member[.index], member[.obj], member[.state]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[set] operator[SEP] Keyword[int] identifier[index] , identifier[Object] identifier[obj] operator[SEP] {
identifier[State] identifier[state] operator[=] identifier[isState] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[return] identifier[set] operator[SEP] identifier[index] , identifier[obj] , identifier[state] operator[SEP] operator[SEP]
}
|
protected String getDiagramResourceForDefinition(DeploymentEntity deployment, String resourceName, DefinitionEntity definition, Map<String, ResourceEntity> resources) {
for (String diagramSuffix: getDiagramSuffixes()) {
String definitionDiagramResource = getDefinitionDiagramResourceName(resourceName, definition, diagramSuffix);
String diagramForFileResource = getGeneralDiagramResourceName(resourceName, definition, diagramSuffix);
if (resources.containsKey(definitionDiagramResource)) {
return definitionDiagramResource;
} else if (resources.containsKey(diagramForFileResource)) {
return diagramForFileResource;
}
}
// no matching diagram found
return null;
}
|
class class_name[name] begin[{]
method[getDiagramResourceForDefinition, return_type[type[String]], modifier[protected], parameter[deployment, resourceName, definition, resources]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=definition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=diagramSuffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDefinitionDiagramResourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=definitionDiagramResource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=definition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=diagramSuffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGeneralDiagramResourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=diagramForFileResource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=definitionDiagramResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=resources, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=diagramForFileResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=resources, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=diagramForFileResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=definitionDiagramResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDiagramSuffixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=diagramSuffix)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}]
|
Keyword[protected] identifier[String] identifier[getDiagramResourceForDefinition] operator[SEP] identifier[DeploymentEntity] identifier[deployment] , identifier[String] identifier[resourceName] , identifier[DefinitionEntity] identifier[definition] , identifier[Map] operator[<] identifier[String] , identifier[ResourceEntity] operator[>] identifier[resources] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[diagramSuffix] operator[:] identifier[getDiagramSuffixes] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[definitionDiagramResource] operator[=] identifier[getDefinitionDiagramResourceName] operator[SEP] identifier[resourceName] , identifier[definition] , identifier[diagramSuffix] operator[SEP] operator[SEP] identifier[String] identifier[diagramForFileResource] operator[=] identifier[getGeneralDiagramResourceName] operator[SEP] identifier[resourceName] , identifier[definition] , identifier[diagramSuffix] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resources] operator[SEP] identifier[containsKey] operator[SEP] identifier[definitionDiagramResource] operator[SEP] operator[SEP] {
Keyword[return] identifier[definitionDiagramResource] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[resources] operator[SEP] identifier[containsKey] operator[SEP] identifier[diagramForFileResource] operator[SEP] operator[SEP] {
Keyword[return] identifier[diagramForFileResource] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
private ResolvedViewable resolve(final Viewable viewable,
final List<MediaType> mediaTypes,
final Class<?> resolvingClass,
final ViewableContext viewableContext,
final Set<TemplateProcessor> templateProcessors) {
for (TemplateProcessor templateProcessor : templateProcessors) {
for (final MediaType mediaType : mediaTypes) {
final ResolvedViewable resolvedViewable = viewableContext
.resolveViewable(viewable, mediaType, resolvingClass, templateProcessor);
if (resolvedViewable != null) {
return resolvedViewable;
}
}
}
return null;
}
|
class class_name[name] begin[{]
method[resolve, return_type[type[ResolvedViewable]], modifier[private], parameter[viewable, mediaTypes, resolvingClass, viewableContext, templateProcessors]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=viewable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mediaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolvingClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=templateProcessor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveViewable, postfix_operators=[], prefix_operators=[], qualifier=viewableContext, selectors=[], type_arguments=None), name=resolvedViewable)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ResolvedViewable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=resolvedViewable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=resolvedViewable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=mediaTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=mediaType)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=MediaType, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=templateProcessors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=templateProcessor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TemplateProcessor, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}]
|
Keyword[private] identifier[ResolvedViewable] identifier[resolve] operator[SEP] Keyword[final] identifier[Viewable] identifier[viewable] , Keyword[final] identifier[List] operator[<] identifier[MediaType] operator[>] identifier[mediaTypes] , Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[resolvingClass] , Keyword[final] identifier[ViewableContext] identifier[viewableContext] , Keyword[final] identifier[Set] operator[<] identifier[TemplateProcessor] operator[>] identifier[templateProcessors] operator[SEP] {
Keyword[for] operator[SEP] identifier[TemplateProcessor] identifier[templateProcessor] operator[:] identifier[templateProcessors] operator[SEP] {
Keyword[for] operator[SEP] Keyword[final] identifier[MediaType] identifier[mediaType] operator[:] identifier[mediaTypes] operator[SEP] {
Keyword[final] identifier[ResolvedViewable] identifier[resolvedViewable] operator[=] identifier[viewableContext] operator[SEP] identifier[resolveViewable] operator[SEP] identifier[viewable] , identifier[mediaType] , identifier[resolvingClass] , identifier[templateProcessor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resolvedViewable] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[resolvedViewable] operator[SEP]
}
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public String varNameToOpName(String varName){
int idx = varName.lastIndexOf(':');
if(idx < 0)
return varName;
return varName.substring(0, idx);
}
|
class class_name[name] begin[{]
method[varNameToOpName, return_type[type[String]], modifier[public], parameter[varName]] begin[{]
local_variable[type[int], idx]
if[binary_operation[member[.idx], <, literal[0]]] begin[{]
return[member[.varName]]
else begin[{]
None
end[}]
return[call[varName.substring, parameter[literal[0], member[.idx]]]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[varNameToOpName] operator[SEP] identifier[String] identifier[varName] operator[SEP] {
Keyword[int] identifier[idx] operator[=] identifier[varName] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[idx] operator[<] Other[0] operator[SEP] Keyword[return] identifier[varName] operator[SEP] Keyword[return] identifier[varName] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[idx] operator[SEP] operator[SEP]
}
|
private MBeanParameterInfo[] getMatchingSignature(List<String> pTypes, List<MBeanParameterInfo[]> pParamInfos) {
OUTER:
for (MBeanParameterInfo[] infos : pParamInfos) {
if (infos.length == 0 && pTypes.size() == 0) {
// No-arg argument
return infos;
}
if (pTypes.size() != infos.length) {
// Number of arguments dont match
continue OUTER;
}
for (int i=0;i<infos.length;i++) {
String type = infos[i].getType();
if (!type.equals(pTypes.get(i))) {
// Non-matching signature
continue OUTER;
}
}
// If we did it until here, we are finished.
return infos;
}
return null;
}
|
class class_name[name] begin[{]
method[getMatchingSignature, return_type[type[MBeanParameterInfo]], modifier[private], parameter[pTypes, pParamInfos]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=infos, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=pTypes, 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=[ReturnStatement(expression=MemberReference(member=infos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=pTypes, selectors=[], type_arguments=None), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=infos, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=OUTER, label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=infos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=pTypes, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=type, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=OUTER, 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=infos, 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), ReturnStatement(expression=MemberReference(member=infos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pParamInfos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=infos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=MBeanParameterInfo, sub_type=None))), label=OUTER)
return[literal[null]]
end[}]
END[}]
|
Keyword[private] identifier[MBeanParameterInfo] operator[SEP] operator[SEP] identifier[getMatchingSignature] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[pTypes] , identifier[List] operator[<] identifier[MBeanParameterInfo] operator[SEP] operator[SEP] operator[>] identifier[pParamInfos] operator[SEP] {
identifier[OUTER] operator[:] Keyword[for] operator[SEP] identifier[MBeanParameterInfo] operator[SEP] operator[SEP] identifier[infos] operator[:] identifier[pParamInfos] operator[SEP] {
Keyword[if] operator[SEP] identifier[infos] operator[SEP] identifier[length] operator[==] Other[0] operator[&&] identifier[pTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[infos] operator[SEP]
}
Keyword[if] operator[SEP] identifier[pTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[infos] operator[SEP] identifier[length] operator[SEP] {
Keyword[continue] identifier[OUTER] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[infos] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[type] operator[=] identifier[infos] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[pTypes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] {
Keyword[continue] identifier[OUTER] operator[SEP]
}
}
Keyword[return] identifier[infos] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public final ProtoParser.service_block_return service_block(Proto proto, Message message) throws RecognitionException {
ProtoParser.service_block_return retval = new ProtoParser.service_block_return();
retval.start = input.LT(1);
Object root_0 = null;
Token SERVICE137=null;
Token ID138=null;
Token LEFTCURLY139=null;
Token RIGHTCURLY141=null;
Token SEMICOLON142=null;
ProtoParser.service_body_return service_body140 = null;
Object SERVICE137_tree=null;
Object ID138_tree=null;
Object LEFTCURLY139_tree=null;
Object RIGHTCURLY141_tree=null;
Object SEMICOLON142_tree=null;
Service service = null;
try {
// com/dyuproject/protostuff/parser/ProtoParser.g:562:5: ( SERVICE ID LEFTCURLY ( service_body[proto, service] )+ RIGHTCURLY ( ( SEMICOLON )? ) )
// com/dyuproject/protostuff/parser/ProtoParser.g:562:9: SERVICE ID LEFTCURLY ( service_body[proto, service] )+ RIGHTCURLY ( ( SEMICOLON )? )
{
root_0 = (Object)adaptor.nil();
SERVICE137=(Token)match(input,SERVICE,FOLLOW_SERVICE_in_service_block2270); if (state.failed) return retval;
if ( state.backtracking==0 ) {
SERVICE137_tree = (Object)adaptor.create(SERVICE137);
adaptor.addChild(root_0, SERVICE137_tree);
}
ID138=(Token)match(input,ID,FOLLOW_ID_in_service_block2272); if (state.failed) return retval;
if ( state.backtracking==0 ) {
ID138_tree = (Object)adaptor.create(ID138);
adaptor.addChild(root_0, ID138_tree);
}
if ( state.backtracking==0 ) {
service = new Service((ID138!=null?ID138.getText():null), message, proto);
proto.addAnnotationsTo(service);
}
LEFTCURLY139=(Token)match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_service_block2276); if (state.failed) return retval;
if ( state.backtracking==0 ) {
LEFTCURLY139_tree = (Object)adaptor.create(LEFTCURLY139);
adaptor.addChild(root_0, LEFTCURLY139_tree);
}
// com/dyuproject/protostuff/parser/ProtoParser.g:566:9: ( service_body[proto, service] )+
int cnt27=0;
loop27:
do {
int alt27=2;
switch ( input.LA(1) ) {
case AT:
case OPTION:
case RPC:
{
alt27=1;
}
break;
}
switch (alt27) {
case 1 :
// com/dyuproject/protostuff/parser/ProtoParser.g:566:10: service_body[proto, service]
{
pushFollow(FOLLOW_service_body_in_service_block2287);
service_body140=service_body(proto, service);
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, service_body140.getTree());
}
break;
default :
if ( cnt27 >= 1 ) break loop27;
if (state.backtracking>0) {state.failed=true; return retval;}
EarlyExitException eee =
new EarlyExitException(27, input);
throw eee;
}
cnt27++;
} while (true);
RIGHTCURLY141=(Token)match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_service_block2292); if (state.failed) return retval;
if ( state.backtracking==0 ) {
RIGHTCURLY141_tree = (Object)adaptor.create(RIGHTCURLY141);
adaptor.addChild(root_0, RIGHTCURLY141_tree);
}
// com/dyuproject/protostuff/parser/ProtoParser.g:566:52: ( ( SEMICOLON )? )
// com/dyuproject/protostuff/parser/ProtoParser.g:566:53: ( SEMICOLON )?
{
// com/dyuproject/protostuff/parser/ProtoParser.g:566:53: ( SEMICOLON )?
int alt28=2;
switch ( input.LA(1) ) {
case SEMICOLON:
{
alt28=1;
}
break;
}
switch (alt28) {
case 1 :
// com/dyuproject/protostuff/parser/ProtoParser.g:566:53: SEMICOLON
{
SEMICOLON142=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_service_block2295); if (state.failed) return retval;
if ( state.backtracking==0 ) {
SEMICOLON142_tree = (Object)adaptor.create(SEMICOLON142);
adaptor.addChild(root_0, SEMICOLON142_tree);
}
}
break;
}
}
if ( state.backtracking==0 ) {
if(service.rpcMethods.isEmpty())
throw new IllegalStateException("Empty Service block: " + service.getName());
if(!proto.annotations.isEmpty())
throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
}
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
}
return retval;
}
|
class class_name[name] begin[{]
method[service_block, return_type[type[ProtoParser]], modifier[final public], parameter[proto, message]] begin[{]
local_variable[type[ProtoParser], retval]
assign[member[retval.start], call[input.LT, parameter[literal[1]]]]
local_variable[type[Object], root_0]
local_variable[type[Token], SERVICE137]
local_variable[type[Token], ID138]
local_variable[type[Token], LEFTCURLY139]
local_variable[type[Token], RIGHTCURLY141]
local_variable[type[Token], SEMICOLON142]
local_variable[type[ProtoParser], service_body140]
local_variable[type[Object], SERVICE137_tree]
local_variable[type[Object], ID138_tree]
local_variable[type[Object], LEFTCURLY139_tree]
local_variable[type[Object], RIGHTCURLY141_tree]
local_variable[type[Object], SEMICOLON142_tree]
local_variable[type[Service], service]
TryStatement(block=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=SERVICE137, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SERVICE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_SERVICE_in_service_block2270, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=Assignment(expressionl=MemberReference(member=SERVICE137_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=SERVICE137, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SERVICE137_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ID138, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_ID_in_service_block2272, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=Assignment(expressionl=MemberReference(member=ID138_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=ID138, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ID138_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=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=Assignment(expressionl=MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=ID138, 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=getText, postfix_operators=[], prefix_operators=[], qualifier=ID138, selectors=[], type_arguments=None)), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=proto, 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=Service, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAnnotationsTo, postfix_operators=[], prefix_operators=[], qualifier=proto, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=LEFTCURLY139, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LEFTCURLY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_LEFTCURLY_in_service_block2276, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=Assignment(expressionl=MemberReference(member=LEFTCURLY139_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=LEFTCURLY139, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LEFTCURLY139_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=cnt27)], modifiers=set(), type=BasicType(dimensions=[], name=int)), DoStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt27)], modifiers=set(), type=BasicType(dimensions=[], name=int)), SwitchStatement(cases=[SwitchStatementCase(case=['AT', 'OPTION', 'RPC'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt27, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_service_body_in_service_block2287, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=service_body140, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=proto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=service_body, 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=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTree, postfix_operators=[], prefix_operators=[], qualifier=service_body140, selectors=[], type_arguments=None)], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cnt27, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>=), else_statement=None, label=None, then_statement=BreakStatement(goto=loop27, 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=Assignment(expressionl=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), ReturnStatement(expression=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=27), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EarlyExitException, sub_type=None)), name=eee)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EarlyExitException, sub_type=None)), ThrowStatement(expression=MemberReference(member=eee, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MemberReference(member=alt27, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MemberReference(member=cnt27, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=loop27), StatementExpression(expression=Assignment(expressionl=MemberReference(member=RIGHTCURLY141, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=RIGHTCURLY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_RIGHTCURLY_in_service_block2292, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=Assignment(expressionl=MemberReference(member=RIGHTCURLY141_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=RIGHTCURLY141, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=RIGHTCURLY141_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)])), BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt28)], modifiers=set(), type=BasicType(dimensions=[], name=int)), SwitchStatement(cases=[SwitchStatementCase(case=['SEMICOLON'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt28, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=SEMICOLON142, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SEMICOLON, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_SEMICOLON_in_service_block2295, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=Assignment(expressionl=MemberReference(member=SEMICOLON142_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=SEMICOLON142, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SEMICOLON142_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)]))]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt28, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=[IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=service.rpcMethods, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Empty Service block: "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=proto.annotations, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Misplaced annotations: "), operandr=MemberReference(member=annotations, postfix_operators=[], prefix_operators=[], qualifier=proto, selectors=[]), operator=+)], 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))]))]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None), 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=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rulePostProcessing, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[])], member=setTokenBoundaries, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=errorNode, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
return[member[.retval]]
end[}]
END[}]
|
Keyword[public] Keyword[final] identifier[ProtoParser] operator[SEP] identifier[service_block_return] identifier[service_block] operator[SEP] identifier[Proto] identifier[proto] , identifier[Message] identifier[message] operator[SEP] Keyword[throws] identifier[RecognitionException] {
identifier[ProtoParser] operator[SEP] identifier[service_block_return] identifier[retval] operator[=] Keyword[new] identifier[ProtoParser] operator[SEP] identifier[service_block_return] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[start] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[Object] identifier[root_0] operator[=] Other[null] operator[SEP] identifier[Token] identifier[SERVICE137] operator[=] Other[null] operator[SEP] identifier[Token] identifier[ID138] operator[=] Other[null] operator[SEP] identifier[Token] identifier[LEFTCURLY139] operator[=] Other[null] operator[SEP] identifier[Token] identifier[RIGHTCURLY141] operator[=] Other[null] operator[SEP] identifier[Token] identifier[SEMICOLON142] operator[=] Other[null] operator[SEP] identifier[ProtoParser] operator[SEP] identifier[service_body_return] identifier[service_body140] operator[=] Other[null] operator[SEP] identifier[Object] identifier[SERVICE137_tree] operator[=] Other[null] operator[SEP] identifier[Object] identifier[ID138_tree] operator[=] Other[null] operator[SEP] identifier[Object] identifier[LEFTCURLY139_tree] operator[=] Other[null] operator[SEP] identifier[Object] identifier[RIGHTCURLY141_tree] operator[=] Other[null] operator[SEP] identifier[Object] identifier[SEMICOLON142_tree] operator[=] Other[null] operator[SEP] identifier[Service] identifier[service] operator[=] Other[null] operator[SEP] Keyword[try] {
{
identifier[root_0] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] identifier[SERVICE137] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[SERVICE] , identifier[FOLLOW_SERVICE_in_service_block2270] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[retval] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[SERVICE137_tree] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[create] operator[SEP] identifier[SERVICE137] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[SERVICE137_tree] operator[SEP] operator[SEP]
}
identifier[ID138] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[ID] , identifier[FOLLOW_ID_in_service_block2272] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[retval] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[ID138_tree] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[create] operator[SEP] identifier[ID138] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[ID138_tree] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[service] operator[=] Keyword[new] identifier[Service] operator[SEP] operator[SEP] identifier[ID138] operator[!=] Other[null] operator[?] identifier[ID138] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] , identifier[message] , identifier[proto] operator[SEP] operator[SEP] identifier[proto] operator[SEP] identifier[addAnnotationsTo] operator[SEP] identifier[service] operator[SEP] operator[SEP]
}
identifier[LEFTCURLY139] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[LEFTCURLY] , identifier[FOLLOW_LEFTCURLY_in_service_block2276] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[retval] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[LEFTCURLY139_tree] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[create] operator[SEP] identifier[LEFTCURLY139] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[LEFTCURLY139_tree] operator[SEP] operator[SEP]
}
Keyword[int] identifier[cnt27] operator[=] Other[0] operator[SEP] identifier[loop27] operator[:] Keyword[do] {
Keyword[int] identifier[alt27] operator[=] Other[2] operator[SEP] Keyword[switch] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] {
Keyword[case] identifier[AT] operator[:] Keyword[case] identifier[OPTION] operator[:] Keyword[case] identifier[RPC] operator[:] {
identifier[alt27] operator[=] Other[1] operator[SEP]
}
Keyword[break] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[alt27] operator[SEP] {
Keyword[case] Other[1] operator[:] {
identifier[pushFollow] operator[SEP] identifier[FOLLOW_service_body_in_service_block2287] operator[SEP] operator[SEP] identifier[service_body140] operator[=] identifier[service_body] operator[SEP] identifier[proto] , identifier[service] 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] identifier[retval] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[service_body140] operator[SEP] identifier[getTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] identifier[cnt27] operator[>=] Other[1] operator[SEP] Keyword[break] identifier[loop27] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[>] Other[0] operator[SEP] {
identifier[state] operator[SEP] identifier[failed] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[retval] operator[SEP]
}
identifier[EarlyExitException] identifier[eee] operator[=] Keyword[new] identifier[EarlyExitException] operator[SEP] Other[27] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[eee] operator[SEP]
}
identifier[cnt27] operator[++] operator[SEP]
}
Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[RIGHTCURLY141] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[RIGHTCURLY] , identifier[FOLLOW_RIGHTCURLY_in_service_block2292] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[retval] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[RIGHTCURLY141_tree] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[create] operator[SEP] identifier[RIGHTCURLY141] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[RIGHTCURLY141_tree] operator[SEP] operator[SEP]
} {
Keyword[int] identifier[alt28] operator[=] Other[2] operator[SEP] Keyword[switch] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] {
Keyword[case] identifier[SEMICOLON] operator[:] {
identifier[alt28] operator[=] Other[1] operator[SEP]
}
Keyword[break] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[alt28] operator[SEP] {
Keyword[case] Other[1] operator[:] {
identifier[SEMICOLON142] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[SEMICOLON] , identifier[FOLLOW_SEMICOLON_in_service_block2295] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[retval] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[SEMICOLON142_tree] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[create] operator[SEP] identifier[SEMICOLON142] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[SEMICOLON142_tree] operator[SEP] operator[SEP]
}
}
Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[service] operator[SEP] identifier[rpcMethods] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[service] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[proto] operator[SEP] identifier[annotations] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[proto] operator[SEP] identifier[annotations] operator[SEP] operator[SEP]
}
}
identifier[retval] operator[SEP] identifier[stop] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[rulePostProcessing] operator[SEP] identifier[root_0] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[setTokenBoundaries] operator[SEP] identifier[retval] operator[SEP] identifier[tree] , identifier[retval] operator[SEP] identifier[start] , identifier[retval] operator[SEP] identifier[stop] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[errorNode] operator[SEP] identifier[input] , identifier[retval] operator[SEP] identifier[start] , identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[re] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] identifier[retval] operator[SEP]
}
|
@Nonnull
public PSExtends readExtendsFromXML (@Nonnull final IMicroElement eExtends)
{
final PSExtends ret = new PSExtends ();
eExtends.forAllAttributes ( (sNS, sAttrName, sVal) -> {
final String sAttrValue = _getAttributeValue (sVal);
if (sAttrName.equals (CSchematronXML.ATTR_RULE))
ret.setRule (sAttrValue);
else
ret.addForeignAttribute (sAttrName, sAttrValue);
});
eExtends.forAllChildElements (eChild -> {
if (CSchematron.NAMESPACE_SCHEMATRON.equals (eChild.getNamespaceURI ()))
{
_warn (ret, "Unsupported Schematron element '" + eChild.getLocalName () + "'");
}
else
_warn (ret, "Unsupported namespace URI '" + eChild.getNamespaceURI () + "'");
});
return ret;
}
|
class class_name[name] begin[{]
method[readExtendsFromXML, return_type[type[PSExtends]], modifier[public], parameter[eExtends]] begin[{]
local_variable[type[PSExtends], ret]
call[eExtends.forAllAttributes, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=_getAttributeValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=sAttrValue)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ATTR_RULE, postfix_operators=[], prefix_operators=[], qualifier=CSchematronXML, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=sAttrName, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sAttrName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sAttrValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addForeignAttribute, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sAttrValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRule, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None))], parameters=[InferredFormalParameter(name=sNS), InferredFormalParameter(name=sAttrName), InferredFormalParameter(name=sVal)])]]
call[eExtends.forAllChildElements, parameter[LambdaExpression(body=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNamespaceURI, postfix_operators=[], prefix_operators=[], qualifier=eChild, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=CSchematron.NAMESPACE_SCHEMATRON, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported namespace URI '"), operandr=MethodInvocation(arguments=[], member=getNamespaceURI, postfix_operators=[], prefix_operators=[], qualifier=eChild, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], member=_warn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported Schematron element '"), operandr=MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=eChild, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], member=_warn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], parameters=[MemberReference(member=eChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
return[member[.ret]]
end[}]
END[}]
|
annotation[@] identifier[Nonnull] Keyword[public] identifier[PSExtends] identifier[readExtendsFromXML] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[IMicroElement] identifier[eExtends] operator[SEP] {
Keyword[final] identifier[PSExtends] identifier[ret] operator[=] Keyword[new] identifier[PSExtends] operator[SEP] operator[SEP] operator[SEP] identifier[eExtends] operator[SEP] identifier[forAllAttributes] operator[SEP] operator[SEP] identifier[sNS] , identifier[sAttrName] , identifier[sVal] operator[SEP] operator[->] {
Keyword[final] identifier[String] identifier[sAttrValue] operator[=] identifier[_getAttributeValue] operator[SEP] identifier[sVal] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sAttrName] operator[SEP] identifier[equals] operator[SEP] identifier[CSchematronXML] operator[SEP] identifier[ATTR_RULE] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[setRule] operator[SEP] identifier[sAttrValue] operator[SEP] operator[SEP] Keyword[else] identifier[ret] operator[SEP] identifier[addForeignAttribute] operator[SEP] identifier[sAttrName] , identifier[sAttrValue] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] identifier[eExtends] operator[SEP] identifier[forAllChildElements] operator[SEP] identifier[eChild] operator[->] {
Keyword[if] operator[SEP] identifier[CSchematron] operator[SEP] identifier[NAMESPACE_SCHEMATRON] operator[SEP] identifier[equals] operator[SEP] identifier[eChild] operator[SEP] identifier[getNamespaceURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[_warn] operator[SEP] identifier[ret] , literal[String] operator[+] identifier[eChild] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] identifier[_warn] operator[SEP] identifier[ret] , literal[String] operator[+] identifier[eChild] operator[SEP] identifier[getNamespaceURI] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP]
}
|
public static Annotation[] getResourcesAnnotations(Method method) {
Map<Class<?>, Annotation> annotations = new HashMap<Class<?>, Annotation>();
for (Annotation annotation : method.getDeclaringClass().getAnnotations()) {
annotations.put(annotation.getClass(), annotation);
}
for (Annotation annotation : method.getAnnotations()) {
annotations.put(annotation.getClass(), annotation);
}
return annotations.values().toArray(new Annotation[annotations.size()]);
}
|
class class_name[name] begin[{]
method[getResourcesAnnotations, return_type[type[Annotation]], modifier[public static], parameter[method]] begin[{]
local_variable[type[Map], annotations]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=annotations, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDeclaringClass, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[MethodInvocation(arguments=[], member=getAnnotations, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=annotations, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAnnotations, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))), label=None)
return[call[annotations.values, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Annotation] operator[SEP] operator[SEP] identifier[getResourcesAnnotations] operator[SEP] identifier[Method] identifier[method] operator[SEP] {
identifier[Map] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[Annotation] operator[>] identifier[annotations] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[Annotation] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Annotation] identifier[annotation] operator[:] identifier[method] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] {
identifier[annotations] operator[SEP] identifier[put] operator[SEP] identifier[annotation] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[annotation] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Annotation] identifier[annotation] operator[:] identifier[method] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] {
identifier[annotations] operator[SEP] identifier[put] operator[SEP] identifier[annotation] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[annotation] operator[SEP] operator[SEP]
}
Keyword[return] identifier[annotations] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Annotation] operator[SEP] identifier[annotations] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static boolean isInternationalPhoneNumber(String s) {
if (isEmpty(s)) return defaultEmptyOK;
String normalizedPhone = stripCharsInBag(s, phoneNumberDelimiters);
return isPositiveInteger(normalizedPhone);
}
|
class class_name[name] begin[{]
method[isInternationalPhoneNumber, return_type[type[boolean]], modifier[public static], parameter[s]] begin[{]
if[call[.isEmpty, parameter[member[.s]]]] begin[{]
return[member[.defaultEmptyOK]]
else begin[{]
None
end[}]
local_variable[type[String], normalizedPhone]
return[call[.isPositiveInteger, parameter[member[.normalizedPhone]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[isInternationalPhoneNumber] operator[SEP] identifier[String] identifier[s] operator[SEP] {
Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[return] identifier[defaultEmptyOK] operator[SEP] identifier[String] identifier[normalizedPhone] operator[=] identifier[stripCharsInBag] operator[SEP] identifier[s] , identifier[phoneNumberDelimiters] operator[SEP] operator[SEP] Keyword[return] identifier[isPositiveInteger] operator[SEP] identifier[normalizedPhone] operator[SEP] operator[SEP]
}
|
public static TransactionEdit createInvalid(long writePointer) {
return new TransactionEdit(writePointer, 0L, State.INVALID, 0L, null, 0L, false, null, null, 0L, 0L, null);
}
|
class class_name[name] begin[{]
method[createInvalid, return_type[type[TransactionEdit]], modifier[public static], parameter[writePointer]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=writePointer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), MemberReference(member=INVALID, postfix_operators=[], prefix_operators=[], qualifier=State, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TransactionEdit, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[TransactionEdit] identifier[createInvalid] operator[SEP] Keyword[long] identifier[writePointer] operator[SEP] {
Keyword[return] Keyword[new] identifier[TransactionEdit] operator[SEP] identifier[writePointer] , Other[0L] , identifier[State] operator[SEP] identifier[INVALID] , Other[0L] , Other[null] , Other[0L] , literal[boolean] , Other[null] , Other[null] , Other[0L] , Other[0L] , Other[null] operator[SEP] operator[SEP]
}
|
public ShortToken visitShort(EditsElement e) throws IOException {
return (ShortToken)visit(tokenizer.read(new ShortToken(e)));
}
|
class class_name[name] begin[{]
method[visitShort, return_type[type[ShortToken]], modifier[public], parameter[e]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[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=ShortToken, sub_type=None))], member=read, postfix_operators=[], prefix_operators=[], qualifier=tokenizer, selectors=[], type_arguments=None)], member=visit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ShortToken, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[ShortToken] identifier[visitShort] operator[SEP] identifier[EditsElement] identifier[e] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] operator[SEP] identifier[ShortToken] operator[SEP] identifier[visit] operator[SEP] identifier[tokenizer] operator[SEP] identifier[read] operator[SEP] Keyword[new] identifier[ShortToken] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setIndexAttachments(java.util.Collection<IndexAttachment> indexAttachments) {
if (indexAttachments == null) {
this.indexAttachments = null;
return;
}
this.indexAttachments = new java.util.ArrayList<IndexAttachment>(indexAttachments);
}
|
class class_name[name] begin[{]
method[setIndexAttachments, return_type[void], modifier[public], parameter[indexAttachments]] begin[{]
if[binary_operation[member[.indexAttachments], ==, literal[null]]] begin[{]
assign[THIS[member[None.indexAttachments]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.indexAttachments]], ClassCreator(arguments=[MemberReference(member=indexAttachments, 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=IndexAttachment, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setIndexAttachments] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[IndexAttachment] operator[>] identifier[indexAttachments] operator[SEP] {
Keyword[if] operator[SEP] identifier[indexAttachments] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[indexAttachments] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[indexAttachments] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[IndexAttachment] operator[>] operator[SEP] identifier[indexAttachments] operator[SEP] operator[SEP]
}
|
@Override
public T select(Object item) {
if (item == null) {
return null;
}
if (itemClass.isInstance(item)) {
return itemClass.cast(item);
}
logger.debug("item [{}] is not assignable to class [{}], returning null", item, itemClass);
return null;
}
|
class class_name[name] begin[{]
method[select, return_type[type[T]], modifier[public], parameter[item]] begin[{]
if[binary_operation[member[.item], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[call[itemClass.isInstance, parameter[member[.item]]]] begin[{]
return[call[itemClass.cast, parameter[member[.item]]]]
else begin[{]
None
end[}]
call[logger.debug, parameter[literal["item [{}] is not assignable to class [{}], returning null"], member[.item], member[.itemClass]]]
return[literal[null]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[select] operator[SEP] identifier[Object] identifier[item] operator[SEP] {
Keyword[if] operator[SEP] identifier[item] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[itemClass] operator[SEP] identifier[isInstance] operator[SEP] identifier[item] operator[SEP] operator[SEP] {
Keyword[return] identifier[itemClass] operator[SEP] identifier[cast] operator[SEP] identifier[item] operator[SEP] operator[SEP]
}
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[item] , identifier[itemClass] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public static void updateFileFromUrl(final String sourceUrl, final String destinationFilePath,
final String username, final String password) throws
UpdateException {
updateFileFromUrl(sourceUrl, destinationFilePath, username, password, URLFileUpdater.factory());
}
|
class class_name[name] begin[{]
method[updateFileFromUrl, return_type[void], modifier[public static], parameter[sourceUrl, destinationFilePath, username, password]] begin[{]
call[.updateFileFromUrl, parameter[member[.sourceUrl], member[.destinationFilePath], member[.username], member[.password], call[URLFileUpdater.factory, parameter[]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[updateFileFromUrl] operator[SEP] Keyword[final] identifier[String] identifier[sourceUrl] , Keyword[final] identifier[String] identifier[destinationFilePath] , Keyword[final] identifier[String] identifier[username] , Keyword[final] identifier[String] identifier[password] operator[SEP] Keyword[throws] identifier[UpdateException] {
identifier[updateFileFromUrl] operator[SEP] identifier[sourceUrl] , identifier[destinationFilePath] , identifier[username] , identifier[password] , identifier[URLFileUpdater] operator[SEP] identifier[factory] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private static final void divmod(byte[] q, byte[] r, int n, byte[] d, int t) {
int rn = 0;
int dt = ((d[t-1] & 0xFF) << 8);
if (t>1) {
dt |= (d[t-2] & 0xFF);
}
while (n-- >= t) {
int z = (rn << 16) | ((r[n] & 0xFF) << 8);
if (n>0) {
z |= (r[n-1] & 0xFF);
}
z/=dt;
rn += mula_small(r,r, n-t+1, d, t, -z);
q[n-t+1] = (byte)((z + rn) & 0xFF); /* rn is 0 or -1 (underflow) */
mula_small(r,r, n-t+1, d, t, -rn);
rn = (r[n] & 0xFF);
r[n] = 0;
}
r[t-1] = (byte)rn;
}
|
class class_name[name] begin[{]
method[divmod, return_type[void], modifier[final private static], parameter[q, r, n, d, t]] begin[{]
local_variable[type[int], rn]
local_variable[type[int], dt]
if[binary_operation[member[.t], >, literal[1]]] begin[{]
assign[member[.dt], binary_operation[member[.d], &, literal[0xFF]]]
else begin[{]
None
end[}]
while[binary_operation[member[.n], >=, member[.t]]] begin[{]
local_variable[type[int], z]
if[binary_operation[member[.n], >, literal[0]]] begin[{]
assign[member[.z], binary_operation[member[.r], &, literal[0xFF]]]
else begin[{]
None
end[}]
assign[member[.z], member[.dt]]
assign[member[.rn], call[.mula_small, parameter[member[.r], member[.r], binary_operation[binary_operation[member[.n], -, member[.t]], +, literal[1]], member[.d], member[.t], member[.z]]]]
assign[member[.q], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=z, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), type=BasicType(dimensions=[], name=byte))]
call[.mula_small, parameter[member[.r], member[.r], binary_operation[binary_operation[member[.n], -, member[.t]], +, literal[1]], member[.d], member[.t], member[.rn]]]
assign[member[.rn], binary_operation[member[.r], &, literal[0xFF]]]
assign[member[.r], literal[0]]
end[}]
assign[member[.r], Cast(expression=MemberReference(member=rn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))]
end[}]
END[}]
|
Keyword[private] Keyword[static] Keyword[final] Keyword[void] identifier[divmod] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[q] , Keyword[byte] operator[SEP] operator[SEP] identifier[r] , Keyword[int] identifier[n] , Keyword[byte] operator[SEP] operator[SEP] identifier[d] , Keyword[int] identifier[t] operator[SEP] {
Keyword[int] identifier[rn] operator[=] Other[0] operator[SEP] Keyword[int] identifier[dt] operator[=] operator[SEP] operator[SEP] identifier[d] operator[SEP] identifier[t] operator[-] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] operator[>] Other[1] operator[SEP] {
identifier[dt] operator[|=] operator[SEP] identifier[d] operator[SEP] identifier[t] operator[-] Other[2] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] identifier[n] operator[--] operator[>=] identifier[t] operator[SEP] {
Keyword[int] identifier[z] operator[=] operator[SEP] identifier[rn] operator[<<] Other[16] operator[SEP] operator[|] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[n] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[>] Other[0] operator[SEP] {
identifier[z] operator[|=] operator[SEP] identifier[r] operator[SEP] identifier[n] operator[-] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP]
}
identifier[z] operator[/=] identifier[dt] operator[SEP] identifier[rn] operator[+=] identifier[mula_small] operator[SEP] identifier[r] , identifier[r] , identifier[n] operator[-] identifier[t] operator[+] Other[1] , identifier[d] , identifier[t] , operator[-] identifier[z] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[n] operator[-] identifier[t] operator[+] Other[1] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[z] operator[+] identifier[rn] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[mula_small] operator[SEP] identifier[r] , identifier[r] , identifier[n] operator[-] identifier[t] operator[+] Other[1] , identifier[d] , identifier[t] , operator[-] identifier[rn] operator[SEP] operator[SEP] identifier[rn] operator[=] operator[SEP] identifier[r] operator[SEP] identifier[n] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[n] operator[SEP] operator[=] Other[0] operator[SEP]
}
identifier[r] operator[SEP] identifier[t] operator[-] Other[1] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[rn] operator[SEP]
}
|
public ServiceFuture<LoadBalancerInner> updateTagsAsync(String resourceGroupName, String loadBalancerName, Map<String, String> tags, final ServiceCallback<LoadBalancerInner> serviceCallback) {
return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags), serviceCallback);
}
|
class class_name[name] begin[{]
method[updateTagsAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, loadBalancerName, tags, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.updateTagsWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.loadBalancerName], member[.tags]]], member[.serviceCallback]]]]
end[}]
END[}]
|
Keyword[public] identifier[ServiceFuture] operator[<] identifier[LoadBalancerInner] operator[>] identifier[updateTagsAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[loadBalancerName] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[tags] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[LoadBalancerInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[updateTagsWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[loadBalancerName] , identifier[tags] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public static <S, N extends Node<?,S,N>> List<S> recoverStatePath(N node){
List<S> states = new LinkedList<S>();
for(N n : node.path()){
states.add(n.state());
}
return states;
}
|
class class_name[name] begin[{]
method[recoverStatePath, return_type[type[List]], modifier[public static], parameter[node]] begin[{]
local_variable[type[List], states]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=state, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=states, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=path, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=n)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=N, sub_type=None))), label=None)
return[member[.states]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[S] , identifier[N] Keyword[extends] identifier[Node] operator[<] operator[?] , identifier[S] , identifier[N] operator[>] operator[>] identifier[List] operator[<] identifier[S] operator[>] identifier[recoverStatePath] operator[SEP] identifier[N] identifier[node] operator[SEP] {
identifier[List] operator[<] identifier[S] operator[>] identifier[states] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[S] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[N] identifier[n] operator[:] identifier[node] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] {
identifier[states] operator[SEP] identifier[add] operator[SEP] identifier[n] operator[SEP] identifier[state] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[states] operator[SEP]
}
|
private Group get_group_i(final String n, final boolean fwd) {
final GroupElement e = find_i(n, fwd);
return e != null && e instanceof Group ? (Group) e : null;
}
|
class class_name[name] begin[{]
method[get_group_i, return_type[type[Group]], modifier[private], parameter[n, fwd]] begin[{]
local_variable[type[GroupElement], e]
return[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None), operator=instanceof), operator=&&), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None)))]
end[}]
END[}]
|
Keyword[private] identifier[Group] identifier[get_group_i] operator[SEP] Keyword[final] identifier[String] identifier[n] , Keyword[final] Keyword[boolean] identifier[fwd] operator[SEP] {
Keyword[final] identifier[GroupElement] identifier[e] operator[=] identifier[find_i] operator[SEP] identifier[n] , identifier[fwd] operator[SEP] operator[SEP] Keyword[return] identifier[e] operator[!=] Other[null] operator[&&] identifier[e] Keyword[instanceof] identifier[Group] operator[?] operator[SEP] identifier[Group] operator[SEP] identifier[e] operator[:] Other[null] operator[SEP]
}
|
public int skip(int maxSize) {
int s = maxSize;
while (hasRemaining()) {
ByteBuf buf = bufs[first];
int remaining = buf.readRemaining();
if (s < remaining) {
buf.moveHead(s);
return maxSize;
} else {
buf.recycle();
first = next(first);
s -= remaining;
}
}
return maxSize - s;
}
|
class class_name[name] begin[{]
method[skip, return_type[type[int]], modifier[public], parameter[maxSize]] begin[{]
local_variable[type[int], s]
while[call[.hasRemaining, parameter[]]] begin[{]
local_variable[type[ByteBuf], buf]
local_variable[type[int], remaining]
if[binary_operation[member[.s], <, member[.remaining]]] begin[{]
call[buf.moveHead, parameter[member[.s]]]
return[member[.maxSize]]
else begin[{]
call[buf.recycle, parameter[]]
assign[member[.first], call[.next, parameter[member[.first]]]]
assign[member[.s], member[.remaining]]
end[}]
end[}]
return[binary_operation[member[.maxSize], -, member[.s]]]
end[}]
END[}]
|
Keyword[public] Keyword[int] identifier[skip] operator[SEP] Keyword[int] identifier[maxSize] operator[SEP] {
Keyword[int] identifier[s] operator[=] identifier[maxSize] operator[SEP] Keyword[while] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[SEP] {
identifier[ByteBuf] identifier[buf] operator[=] identifier[bufs] operator[SEP] identifier[first] operator[SEP] operator[SEP] Keyword[int] identifier[remaining] operator[=] identifier[buf] operator[SEP] identifier[readRemaining] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[<] identifier[remaining] operator[SEP] {
identifier[buf] operator[SEP] identifier[moveHead] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[return] identifier[maxSize] operator[SEP]
}
Keyword[else] {
identifier[buf] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP] identifier[first] operator[=] identifier[next] operator[SEP] identifier[first] operator[SEP] operator[SEP] identifier[s] operator[-=] identifier[remaining] operator[SEP]
}
}
Keyword[return] identifier[maxSize] operator[-] identifier[s] operator[SEP]
}
|
private String toSQLPattern(String attribute) {
String pattern = attribute.replace("*", "%");
if (!pattern.startsWith("%")) {
pattern = "%" + pattern;
}
if (!pattern.endsWith("%")) {
pattern = pattern.concat("%");
}
return pattern;
}
|
class class_name[name] begin[{]
method[toSQLPattern, return_type[type[String]], modifier[private], parameter[attribute]] begin[{]
local_variable[type[String], pattern]
if[call[pattern.startsWith, parameter[literal["%"]]]] begin[{]
assign[member[.pattern], binary_operation[literal["%"], +, member[.pattern]]]
else begin[{]
None
end[}]
if[call[pattern.endsWith, parameter[literal["%"]]]] begin[{]
assign[member[.pattern], call[pattern.concat, parameter[literal["%"]]]]
else begin[{]
None
end[}]
return[member[.pattern]]
end[}]
END[}]
|
Keyword[private] identifier[String] identifier[toSQLPattern] operator[SEP] identifier[String] identifier[attribute] operator[SEP] {
identifier[String] identifier[pattern] operator[=] identifier[attribute] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[pattern] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[pattern] operator[=] literal[String] operator[+] identifier[pattern] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[pattern] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[pattern] operator[=] identifier[pattern] operator[SEP] identifier[concat] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[pattern] operator[SEP]
}
|
@Nullable
public String encodeURL (@Nullable final String sUrl)
{
if (StringHelper.hasText (m_sEncodeUrlSuffix))
return StringHelper.getNotNull (sUrl) + m_sEncodeUrlSuffix;
return sUrl;
}
|
class class_name[name] begin[{]
method[encodeURL, return_type[type[String]], modifier[public], parameter[sUrl]] begin[{]
if[call[StringHelper.hasText, parameter[member[.m_sEncodeUrlSuffix]]]] begin[{]
return[binary_operation[call[StringHelper.getNotNull, parameter[member[.sUrl]]], +, member[.m_sEncodeUrlSuffix]]]
else begin[{]
None
end[}]
return[member[.sUrl]]
end[}]
END[}]
|
annotation[@] identifier[Nullable] Keyword[public] identifier[String] identifier[encodeURL] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[sUrl] operator[SEP] {
Keyword[if] operator[SEP] identifier[StringHelper] operator[SEP] identifier[hasText] operator[SEP] identifier[m_sEncodeUrlSuffix] operator[SEP] operator[SEP] Keyword[return] identifier[StringHelper] operator[SEP] identifier[getNotNull] operator[SEP] identifier[sUrl] operator[SEP] operator[+] identifier[m_sEncodeUrlSuffix] operator[SEP] Keyword[return] identifier[sUrl] operator[SEP]
}
|
@SuppressWarnings("unchecked")
public <T> T fromJson(String json, Type typeOfT) throws JsonSyntaxException {
if (json == null) {
return null;
}
StringReader reader = new StringReader(json);
T target = (T) fromJson(reader, typeOfT);
return target;
}
|
class class_name[name] begin[{]
method[fromJson, return_type[type[T]], modifier[public], parameter[json, typeOfT]] begin[{]
if[binary_operation[member[.json], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[StringReader], reader]
local_variable[type[T], target]
return[member[.target]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[fromJson] operator[SEP] identifier[String] identifier[json] , identifier[Type] identifier[typeOfT] operator[SEP] Keyword[throws] identifier[JsonSyntaxException] {
Keyword[if] operator[SEP] identifier[json] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[StringReader] identifier[reader] operator[=] Keyword[new] identifier[StringReader] operator[SEP] identifier[json] operator[SEP] operator[SEP] identifier[T] identifier[target] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[fromJson] operator[SEP] identifier[reader] , identifier[typeOfT] operator[SEP] operator[SEP] Keyword[return] identifier[target] operator[SEP]
}
|
@SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "no npe in getters")
public CreateContainerCmd fillContainerConfig(CreateContainerCmd containerConfig,
@CheckForNull java.util.function.Function<String, String> resolveVar) {
if (StringUtils.isNotBlank(hostname)) {
containerConfig.withHostName(hostname);
}
String[] cmd = getDockerCommandArray();
if (cmd.length > 0) {
containerConfig.withCmd(cmd);
}
HostConfig hostConfig = containerConfig.getHostConfig();
hostConfig.withPortBindings(Iterables.toArray(getPortMappings(), PortBinding.class));
if (BooleanUtils.isTrue(getBindAllPorts())) {
hostConfig.withPublishAllPorts(getBindAllPorts());
}
if (BooleanUtils.isTrue(getPrivileged())) {
hostConfig.withPrivileged(getPrivileged());
}
if (getCpuShares() != null && getCpuShares() > 0) {
hostConfig.withCpuShares(getCpuShares());
}
if (getMemoryLimit() != null && getMemoryLimit() > 0) {
Long memoryInByte = getMemoryLimit() * 1024 * 1024;
hostConfig.withMemory(memoryInByte);
}
if (CollectionUtils.isNotEmpty(getDnsHosts())) {
hostConfig.withDns(getDnsHosts().toArray(new String[0]));
}
if (CollectionUtils.isNotEmpty(getDockerLabels())) {
Map<String, String> labels = containerConfig.getLabels();
if (labels == null) labels = new HashMap<>();
for (String s : getDockerLabels()) {
String[] l = s.split("=");
if (l.length > 1) {
labels.put(l[0], l[1]);
}
}
containerConfig.withLabels(labels);
}
// https://github.com/docker/docker/blob/ed257420025772acc38c51b0f018de3ee5564d0f/runconfig/parse.go#L182-L196
if (CollectionUtils.isNotEmpty(getVolumes())) {
ArrayList<Volume> vols = new ArrayList<>();
ArrayList<Bind> binds = new ArrayList<>();
for (String vol : getVolumes()) {
if (nonNull(resolveVar)) vol = resolveVar.apply(vol);
final String[] group = vol.split(":");
if (group.length > 1) {
if (group[1].equals("/")) {
throw new IllegalArgumentException("Invalid bind mount: destination can't be '/'");
}
binds.add(Bind.parse(vol));
} else if (vol.equals("/")) {
throw new IllegalArgumentException("Invalid volume: path can't be '/'");
} else {
vols.add(new Volume(vol));
}
}
containerConfig.withVolumes(vols.toArray(new Volume[0]));
hostConfig.withBinds(binds.toArray(new Bind[0]));
}
if (CollectionUtils.isNotEmpty(getVolumesFrom())) {
ArrayList<VolumesFrom> volFrom = new ArrayList<>();
for (String volFromStr : getVolumesFrom()) {
volFrom.add(new VolumesFrom(volFromStr));
}
hostConfig.withVolumesFrom(volFrom.toArray(new VolumesFrom[0]));
}
if (BooleanUtils.isTrue(getTty())) {
containerConfig.withTty(getTty());
}
if (CollectionUtils.isNotEmpty(getEnvironment())) {
containerConfig.withEnv(getEnvironment().toArray(new String[0]));
}
if (StringUtils.isNotBlank(getMacAddress())) {
containerConfig.withMacAddress(getMacAddress());
}
if (CollectionUtils.isNotEmpty(getExtraHosts())) {
hostConfig.withExtraHosts(getExtraHosts().toArray(new String[0]));
}
if (StringUtils.isNotBlank(getNetworkMode())) {
hostConfig.withNetworkMode(getNetworkMode());
}
if (!getDevices().isEmpty()) {
hostConfig.withDevices(
getDevices().stream().map(Device::parse).collect(Collectors.toList())
);
}
if (StringUtils.isNotBlank(getCpusetCpus())) {
hostConfig.withCpusetCpus(getCpusetCpus());
}
if (StringUtils.isNotBlank(getCpusetMems())) {
hostConfig.withCpusetMems(getCpusetMems());
}
if (!getLinks().isEmpty()) {
hostConfig.withLinks(
getLinks().stream().map(Link::parse).collect(Collectors.toList())
);
}
if (nonNull(shmSize)) {
hostConfig.withShmSize(shmSize);
}
if (nonNull(restartPolicy)) {
hostConfig.withRestartPolicy(restartPolicy.getRestartPolicy());
}
if (StringUtils.isNotBlank(getWorkdir())) {
containerConfig.withWorkingDir(nonNull(resolveVar) ? resolveVar.apply(workdir) : workdir);
}
if (StringUtils.isNotBlank(getUser())) {
containerConfig.withUser(getUser());
}
return containerConfig;
}
|
class class_name[name] begin[{]
method[fillContainerConfig, return_type[type[CreateContainerCmd]], modifier[public], parameter[containerConfig, resolveVar]] begin[{]
if[call[StringUtils.isNotBlank, parameter[member[.hostname]]]] begin[{]
call[containerConfig.withHostName, parameter[member[.hostname]]]
else begin[{]
None
end[}]
local_variable[type[String], cmd]
if[binary_operation[member[cmd.length], >, literal[0]]] begin[{]
call[containerConfig.withCmd, parameter[member[.cmd]]]
else begin[{]
None
end[}]
local_variable[type[HostConfig], hostConfig]
call[hostConfig.withPortBindings, parameter[call[Iterables.toArray, parameter[call[.getPortMappings, parameter[]], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PortBinding, sub_type=None))]]]]
if[call[BooleanUtils.isTrue, parameter[call[.getBindAllPorts, parameter[]]]]] begin[{]
call[hostConfig.withPublishAllPorts, parameter[call[.getBindAllPorts, parameter[]]]]
else begin[{]
None
end[}]
if[call[BooleanUtils.isTrue, parameter[call[.getPrivileged, parameter[]]]]] begin[{]
call[hostConfig.withPrivileged, parameter[call[.getPrivileged, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[.getCpuShares, parameter[]], !=, literal[null]], &&, binary_operation[call[.getCpuShares, parameter[]], >, literal[0]]]] begin[{]
call[hostConfig.withCpuShares, parameter[call[.getCpuShares, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[.getMemoryLimit, parameter[]], !=, literal[null]], &&, binary_operation[call[.getMemoryLimit, parameter[]], >, literal[0]]]] begin[{]
local_variable[type[Long], memoryInByte]
call[hostConfig.withMemory, parameter[member[.memoryInByte]]]
else begin[{]
None
end[}]
if[call[CollectionUtils.isNotEmpty, parameter[call[.getDnsHosts, parameter[]]]]] begin[{]
call[hostConfig.withDns, parameter[call[.getDnsHosts, parameter[]]]]
else begin[{]
None
end[}]
if[call[CollectionUtils.isNotEmpty, parameter[call[.getDockerLabels, parameter[]]]]] begin[{]
local_variable[type[Map], labels]
if[binary_operation[member[.labels], ==, literal[null]]] begin[{]
assign[member[.labels], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=split, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=l)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=put, postfix_operators=[], prefix_operators=[], qualifier=labels, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDockerLabels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[containerConfig.withLabels, parameter[member[.labels]]]
else begin[{]
None
end[}]
if[call[CollectionUtils.isNotEmpty, parameter[call[.getVolumes, parameter[]]]]] begin[{]
local_variable[type[ArrayList], vols]
local_variable[type[ArrayList], binds]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=resolveVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nonNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=vol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=vol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=resolveVar, selectors=[], type_arguments=None)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":")], member=split, postfix_operators=[], prefix_operators=[], qualifier=vol, selectors=[], type_arguments=None), name=group)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=group, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=vol, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=vol, 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=Volume, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=vols, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid volume: path can't be '/'")], 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, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid bind mount: destination can't be '/'")], 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)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=vol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=Bind, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=binds, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getVolumes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=vol)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[containerConfig.withVolumes, parameter[call[vols.toArray, parameter[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=Volume, sub_type=None))]]]]
call[hostConfig.withBinds, parameter[call[binds.toArray, parameter[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=Bind, sub_type=None))]]]]
else begin[{]
None
end[}]
if[call[CollectionUtils.isNotEmpty, parameter[call[.getVolumesFrom, parameter[]]]]] begin[{]
local_variable[type[ArrayList], volFrom]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=volFromStr, 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=VolumesFrom, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=volFrom, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getVolumesFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=volFromStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[hostConfig.withVolumesFrom, parameter[call[volFrom.toArray, parameter[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=VolumesFrom, sub_type=None))]]]]
else begin[{]
None
end[}]
if[call[BooleanUtils.isTrue, parameter[call[.getTty, parameter[]]]]] begin[{]
call[containerConfig.withTty, parameter[call[.getTty, parameter[]]]]
else begin[{]
None
end[}]
if[call[CollectionUtils.isNotEmpty, parameter[call[.getEnvironment, parameter[]]]]] begin[{]
call[containerConfig.withEnv, parameter[call[.getEnvironment, parameter[]]]]
else begin[{]
None
end[}]
if[call[StringUtils.isNotBlank, parameter[call[.getMacAddress, parameter[]]]]] begin[{]
call[containerConfig.withMacAddress, parameter[call[.getMacAddress, parameter[]]]]
else begin[{]
None
end[}]
if[call[CollectionUtils.isNotEmpty, parameter[call[.getExtraHosts, parameter[]]]]] begin[{]
call[hostConfig.withExtraHosts, parameter[call[.getExtraHosts, parameter[]]]]
else begin[{]
None
end[}]
if[call[StringUtils.isNotBlank, parameter[call[.getNetworkMode, parameter[]]]]] begin[{]
call[hostConfig.withNetworkMode, parameter[call[.getNetworkMode, parameter[]]]]
else begin[{]
None
end[}]
if[call[.getDevices, parameter[]]] begin[{]
call[hostConfig.withDevices, parameter[call[.getDevices, parameter[]]]]
else begin[{]
None
end[}]
if[call[StringUtils.isNotBlank, parameter[call[.getCpusetCpus, parameter[]]]]] begin[{]
call[hostConfig.withCpusetCpus, parameter[call[.getCpusetCpus, parameter[]]]]
else begin[{]
None
end[}]
if[call[StringUtils.isNotBlank, parameter[call[.getCpusetMems, parameter[]]]]] begin[{]
call[hostConfig.withCpusetMems, parameter[call[.getCpusetMems, parameter[]]]]
else begin[{]
None
end[}]
if[call[.getLinks, parameter[]]] begin[{]
call[hostConfig.withLinks, parameter[call[.getLinks, parameter[]]]]
else begin[{]
None
end[}]
if[call[.nonNull, parameter[member[.shmSize]]]] begin[{]
call[hostConfig.withShmSize, parameter[member[.shmSize]]]
else begin[{]
None
end[}]
if[call[.nonNull, parameter[member[.restartPolicy]]]] begin[{]
call[hostConfig.withRestartPolicy, parameter[call[restartPolicy.getRestartPolicy, parameter[]]]]
else begin[{]
None
end[}]
if[call[StringUtils.isNotBlank, parameter[call[.getWorkdir, parameter[]]]]] begin[{]
call[containerConfig.withWorkingDir, parameter[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=resolveVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nonNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=MemberReference(member=workdir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=workdir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=resolveVar, selectors=[], type_arguments=None))]]
else begin[{]
None
end[}]
if[call[StringUtils.isNotBlank, parameter[call[.getUser, parameter[]]]]] begin[{]
call[containerConfig.withUser, parameter[call[.getUser, parameter[]]]]
else begin[{]
None
end[}]
return[member[.containerConfig]]
end[}]
END[}]
|
annotation[@] identifier[SuppressFBWarnings] operator[SEP] identifier[value] operator[=] literal[String] , identifier[justification] operator[=] literal[String] operator[SEP] Keyword[public] identifier[CreateContainerCmd] identifier[fillContainerConfig] operator[SEP] identifier[CreateContainerCmd] identifier[containerConfig] , annotation[@] identifier[CheckForNull] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[function] operator[SEP] identifier[Function] operator[<] identifier[String] , identifier[String] operator[>] identifier[resolveVar] operator[SEP] {
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[hostname] operator[SEP] operator[SEP] {
identifier[containerConfig] operator[SEP] identifier[withHostName] operator[SEP] identifier[hostname] operator[SEP] operator[SEP]
}
identifier[String] operator[SEP] operator[SEP] identifier[cmd] operator[=] identifier[getDockerCommandArray] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmd] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[containerConfig] operator[SEP] identifier[withCmd] operator[SEP] identifier[cmd] operator[SEP] operator[SEP]
}
identifier[HostConfig] identifier[hostConfig] operator[=] identifier[containerConfig] operator[SEP] identifier[getHostConfig] operator[SEP] operator[SEP] operator[SEP] identifier[hostConfig] operator[SEP] identifier[withPortBindings] operator[SEP] identifier[Iterables] operator[SEP] identifier[toArray] operator[SEP] identifier[getPortMappings] operator[SEP] operator[SEP] , identifier[PortBinding] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[BooleanUtils] operator[SEP] identifier[isTrue] operator[SEP] identifier[getBindAllPorts] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withPublishAllPorts] operator[SEP] identifier[getBindAllPorts] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[BooleanUtils] operator[SEP] identifier[isTrue] operator[SEP] identifier[getPrivileged] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withPrivileged] operator[SEP] identifier[getPrivileged] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[getCpuShares] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[getCpuShares] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withCpuShares] operator[SEP] identifier[getCpuShares] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[getMemoryLimit] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[getMemoryLimit] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[Long] identifier[memoryInByte] operator[=] identifier[getMemoryLimit] operator[SEP] operator[SEP] operator[*] Other[1024] operator[*] Other[1024] operator[SEP] identifier[hostConfig] operator[SEP] identifier[withMemory] operator[SEP] identifier[memoryInByte] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[CollectionUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[getDnsHosts] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withDns] operator[SEP] identifier[getDnsHosts] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[CollectionUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[getDockerLabels] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[labels] operator[=] identifier[containerConfig] operator[SEP] identifier[getLabels] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[labels] operator[==] Other[null] operator[SEP] identifier[labels] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[getDockerLabels] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[l] operator[=] identifier[s] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] {
identifier[labels] operator[SEP] identifier[put] operator[SEP] identifier[l] operator[SEP] Other[0] operator[SEP] , identifier[l] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[containerConfig] operator[SEP] identifier[withLabels] operator[SEP] identifier[labels] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[CollectionUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[getVolumes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[ArrayList] operator[<] identifier[Volume] operator[>] identifier[vols] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[Bind] operator[>] identifier[binds] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[vol] operator[:] identifier[getVolumes] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[nonNull] operator[SEP] identifier[resolveVar] operator[SEP] operator[SEP] identifier[vol] operator[=] identifier[resolveVar] operator[SEP] identifier[apply] operator[SEP] identifier[vol] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[group] operator[=] identifier[vol] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[group] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] {
Keyword[if] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[binds] operator[SEP] identifier[add] operator[SEP] identifier[Bind] operator[SEP] identifier[parse] operator[SEP] identifier[vol] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[vol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[vols] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Volume] operator[SEP] identifier[vol] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[containerConfig] operator[SEP] identifier[withVolumes] operator[SEP] identifier[vols] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Volume] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[hostConfig] operator[SEP] identifier[withBinds] operator[SEP] identifier[binds] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Bind] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[CollectionUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[getVolumesFrom] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[ArrayList] operator[<] identifier[VolumesFrom] operator[>] identifier[volFrom] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[volFromStr] operator[:] identifier[getVolumesFrom] operator[SEP] operator[SEP] operator[SEP] {
identifier[volFrom] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[VolumesFrom] operator[SEP] identifier[volFromStr] operator[SEP] operator[SEP] operator[SEP]
}
identifier[hostConfig] operator[SEP] identifier[withVolumesFrom] operator[SEP] identifier[volFrom] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[VolumesFrom] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[BooleanUtils] operator[SEP] identifier[isTrue] operator[SEP] identifier[getTty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[containerConfig] operator[SEP] identifier[withTty] operator[SEP] identifier[getTty] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[CollectionUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[getEnvironment] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[containerConfig] operator[SEP] identifier[withEnv] operator[SEP] identifier[getEnvironment] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getMacAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[containerConfig] operator[SEP] identifier[withMacAddress] operator[SEP] identifier[getMacAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[CollectionUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[getExtraHosts] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withExtraHosts] operator[SEP] identifier[getExtraHosts] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getNetworkMode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withNetworkMode] operator[SEP] identifier[getNetworkMode] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[getDevices] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withDevices] operator[SEP] identifier[getDevices] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Device] operator[::] identifier[parse] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getCpusetCpus] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withCpusetCpus] operator[SEP] identifier[getCpusetCpus] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getCpusetMems] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withCpusetMems] operator[SEP] identifier[getCpusetMems] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[getLinks] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withLinks] operator[SEP] identifier[getLinks] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Link] operator[::] identifier[parse] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[nonNull] operator[SEP] identifier[shmSize] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withShmSize] operator[SEP] identifier[shmSize] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[nonNull] operator[SEP] identifier[restartPolicy] operator[SEP] operator[SEP] {
identifier[hostConfig] operator[SEP] identifier[withRestartPolicy] operator[SEP] identifier[restartPolicy] operator[SEP] identifier[getRestartPolicy] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getWorkdir] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[containerConfig] operator[SEP] identifier[withWorkingDir] operator[SEP] identifier[nonNull] operator[SEP] identifier[resolveVar] operator[SEP] operator[?] identifier[resolveVar] operator[SEP] identifier[apply] operator[SEP] identifier[workdir] operator[SEP] operator[:] identifier[workdir] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getUser] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[containerConfig] operator[SEP] identifier[withUser] operator[SEP] identifier[getUser] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[containerConfig] operator[SEP]
}
|
public Collection<Variable> getVariables() {
if (parent == null) {
return getLocalVariables();
}
List<Variable> result = new ArrayList<>();
result.addAll(parent.getVariables());
result.addAll(getLocalVariables());
return result;
}
|
class class_name[name] begin[{]
method[getVariables, return_type[type[Collection]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.parent], ==, literal[null]]] begin[{]
return[call[.getLocalVariables, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[List], result]
call[result.addAll, parameter[call[parent.getVariables, parameter[]]]]
call[result.addAll, parameter[call[.getLocalVariables, parameter[]]]]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] identifier[Collection] operator[<] identifier[Variable] operator[>] identifier[getVariables] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[parent] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[getLocalVariables] operator[SEP] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[Variable] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[parent] operator[SEP] identifier[getVariables] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[getLocalVariables] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public void marshall(DeletePermissionRequest deletePermissionRequest, ProtocolMarshaller protocolMarshaller) {
if (deletePermissionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deletePermissionRequest.getCertificateAuthorityArn(), CERTIFICATEAUTHORITYARN_BINDING);
protocolMarshaller.marshall(deletePermissionRequest.getPrincipal(), PRINCIPAL_BINDING);
protocolMarshaller.marshall(deletePermissionRequest.getSourceAccount(), SOURCEACCOUNT_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[deletePermissionRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.deletePermissionRequest], ==, 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=getCertificateAuthorityArn, postfix_operators=[], prefix_operators=[], qualifier=deletePermissionRequest, selectors=[], type_arguments=None), MemberReference(member=CERTIFICATEAUTHORITYARN_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=getPrincipal, postfix_operators=[], prefix_operators=[], qualifier=deletePermissionRequest, selectors=[], type_arguments=None), MemberReference(member=PRINCIPAL_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=getSourceAccount, postfix_operators=[], prefix_operators=[], qualifier=deletePermissionRequest, selectors=[], type_arguments=None), MemberReference(member=SOURCEACCOUNT_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[DeletePermissionRequest] identifier[deletePermissionRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[deletePermissionRequest] 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[deletePermissionRequest] operator[SEP] identifier[getCertificateAuthorityArn] operator[SEP] operator[SEP] , identifier[CERTIFICATEAUTHORITYARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deletePermissionRequest] operator[SEP] identifier[getPrincipal] operator[SEP] operator[SEP] , identifier[PRINCIPAL_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deletePermissionRequest] operator[SEP] identifier[getSourceAccount] operator[SEP] operator[SEP] , identifier[SOURCEACCOUNT_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
protected void validateEmailAddress(final List<Diagnostic> diags) {
if (!isEmpty()) {
String value = getValueAsString();
String errorMessage = getComponentModel().errorMessage;
// Email Pattern
if (!Pattern.matches(
"^(?:\".+\"|[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+)@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)+$",
value)) {
diags.add(createErrorDiagnostic(errorMessage, this));
}
// Maximum Length
int max = getMaxLength();
if (max > 0 && value.length() > max) {
diags.add(
createErrorDiagnostic(InternalMessages.DEFAULT_VALIDATION_ERROR_MAX_LENGTH,
this,
String.valueOf(max)));
}
}
}
|
class class_name[name] begin[{]
method[validateEmailAddress, return_type[void], modifier[protected], parameter[diags]] begin[{]
if[call[.isEmpty, parameter[]]] begin[{]
local_variable[type[String], value]
local_variable[type[String], errorMessage]
if[call[Pattern.matches, parameter[literal["^(?:\".+\"|[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+)@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)+$"], member[.value]]]] begin[{]
call[diags.add, parameter[call[.createErrorDiagnostic, parameter[member[.errorMessage], THIS[]]]]]
else begin[{]
None
end[}]
local_variable[type[int], max]
if[binary_operation[binary_operation[member[.max], >, literal[0]], &&, binary_operation[call[value.length, parameter[]], >, member[.max]]]] begin[{]
call[diags.add, parameter[call[.createErrorDiagnostic, parameter[member[InternalMessages.DEFAULT_VALIDATION_ERROR_MAX_LENGTH], THIS[], call[String.valueOf, parameter[member[.max]]]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[validateEmailAddress] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Diagnostic] operator[>] identifier[diags] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[value] operator[=] identifier[getValueAsString] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[errorMessage] operator[=] identifier[getComponentModel] operator[SEP] operator[SEP] operator[SEP] identifier[errorMessage] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] literal[String] , identifier[value] operator[SEP] operator[SEP] {
identifier[diags] operator[SEP] identifier[add] operator[SEP] identifier[createErrorDiagnostic] operator[SEP] identifier[errorMessage] , Keyword[this] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[int] identifier[max] operator[=] identifier[getMaxLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[max] operator[>] Other[0] operator[&&] identifier[value] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[max] operator[SEP] {
identifier[diags] operator[SEP] identifier[add] operator[SEP] identifier[createErrorDiagnostic] operator[SEP] identifier[InternalMessages] operator[SEP] identifier[DEFAULT_VALIDATION_ERROR_MAX_LENGTH] , Keyword[this] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[max] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public int[] extractLongArray() {
int[] argout;
argout = new int[values.length];
for (int i = 0; i < values.length; i++) {
argout[i] = Integer.parseInt(values[i]);
}
return argout;
}
|
class class_name[name] begin[{]
method[extractLongArray, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[int], argout]
assign[member[.argout], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=argout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, 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=values, 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[member[.argout]]
end[}]
END[}]
|
Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[extractLongArray] operator[SEP] operator[SEP] {
Keyword[int] operator[SEP] operator[SEP] identifier[argout] operator[SEP] identifier[argout] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[values] 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[values] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[argout] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[argout] operator[SEP]
}
|
@Override
public void visit(JavaClass someObj) {
currentClass = someObj.getClassName();
currentMethod = null;
currentCFG = null;
currentLockDataFlow = null;
sawDateClass = false;
}
|
class class_name[name] begin[{]
method[visit, return_type[void], modifier[public], parameter[someObj]] begin[{]
assign[member[.currentClass], call[someObj.getClassName, parameter[]]]
assign[member[.currentMethod], literal[null]]
assign[member[.currentCFG], literal[null]]
assign[member[.currentLockDataFlow], literal[null]]
assign[member[.sawDateClass], literal[false]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visit] operator[SEP] identifier[JavaClass] identifier[someObj] operator[SEP] {
identifier[currentClass] operator[=] identifier[someObj] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] identifier[currentMethod] operator[=] Other[null] operator[SEP] identifier[currentCFG] operator[=] Other[null] operator[SEP] identifier[currentLockDataFlow] operator[=] Other[null] operator[SEP] identifier[sawDateClass] operator[=] literal[boolean] operator[SEP]
}
|
public Swagger2MarkupConfigBuilder withInterDocumentCrossReferences(String prefix) {
Validate.notNull(prefix, "%s must not be null", "prefix");
config.interDocumentCrossReferencesEnabled = true;
config.interDocumentCrossReferencesPrefix = prefix;
return this;
}
|
class class_name[name] begin[{]
method[withInterDocumentCrossReferences, return_type[type[Swagger2MarkupConfigBuilder]], modifier[public], parameter[prefix]] begin[{]
call[Validate.notNull, parameter[member[.prefix], literal["%s must not be null"], literal["prefix"]]]
assign[member[config.interDocumentCrossReferencesEnabled], literal[true]]
assign[member[config.interDocumentCrossReferencesPrefix], member[.prefix]]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[Swagger2MarkupConfigBuilder] identifier[withInterDocumentCrossReferences] operator[SEP] identifier[String] identifier[prefix] operator[SEP] {
identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[prefix] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[interDocumentCrossReferencesEnabled] operator[=] literal[boolean] operator[SEP] identifier[config] operator[SEP] identifier[interDocumentCrossReferencesPrefix] operator[=] identifier[prefix] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
boolean matchXmlDeclaration(
final boolean blockMatching,
final int markupLevel, final int markupBlockIndex) {
checkMarkupLevel(markupLevel);
if (this.markupSelectorItem.anyLevel() || markupLevel == 0 || (this.prev != null && this.prev.matchedMarkupLevels[markupLevel - 1])) {
// This text has not matched yet, but might match, so we should check
this.matchesThisLevel = this.markupSelectorItem.matchesXmlDeclaration(markupBlockIndex, this.markupBlockMatchingCounter);
if (matchesPreviousOrCurrentLevel(markupLevel)) {
// This filter was already matched by a previous level (through an "open" event), so just delegate to next.
if (this.next != null) {
return this.next.matchXmlDeclaration(blockMatching, markupLevel, markupBlockIndex);
}
return (blockMatching? true : this.matchesThisLevel);
} else if (this.matchesThisLevel) {
// This filter was not matched before. So the fact that it matches now means we need to consume it,
// therefore not delegating.
return (this.next == null);
}
} else if (matchesPreviousOrCurrentLevel(markupLevel)) {
// This filter was already matched by a previous level (through an "open" event), so just delegate to next.
if (this.next != null) {
return this.next.matchXmlDeclaration(blockMatching, markupLevel, markupBlockIndex);
}
return blockMatching;
}
return false;
}
|
class class_name[name] begin[{]
method[matchXmlDeclaration, return_type[type[boolean]], modifier[default], parameter[blockMatching, markupLevel, markupBlockIndex]] begin[{]
call[.checkMarkupLevel, parameter[member[.markupLevel]]]
if[binary_operation[binary_operation[THIS[member[None.markupSelectorItem]call[None.anyLevel, parameter[]]], ||, binary_operation[member[.markupLevel], ==, literal[0]]], ||, binary_operation[binary_operation[THIS[member[None.prev]], !=, literal[null]], &&, THIS[member[None.prev]member[None.matchedMarkupLevels]ArraySelector(index=BinaryOperation(operandl=MemberReference(member=markupLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]]]] begin[{]
assign[THIS[member[None.matchesThisLevel]], THIS[member[None.markupSelectorItem]call[None.matchesXmlDeclaration, parameter[member[.markupBlockIndex], THIS[member[None.markupBlockMatchingCounter]]]]]]
if[call[.matchesPreviousOrCurrentLevel, parameter[member[.markupLevel]]]] begin[{]
if[binary_operation[THIS[member[None.next]], !=, literal[null]]] begin[{]
return[THIS[member[None.next]call[None.matchXmlDeclaration, parameter[member[.blockMatching], member[.markupLevel], member[.markupBlockIndex]]]]]
else begin[{]
None
end[}]
return[TernaryExpression(condition=MemberReference(member=blockMatching, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=matchesThisLevel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true))]
else begin[{]
if[THIS[member[None.matchesThisLevel]]] begin[{]
return[binary_operation[THIS[member[None.next]], ==, literal[null]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
if[call[.matchesPreviousOrCurrentLevel, parameter[member[.markupLevel]]]] begin[{]
if[binary_operation[THIS[member[None.next]], !=, literal[null]]] begin[{]
return[THIS[member[None.next]call[None.matchXmlDeclaration, parameter[member[.blockMatching], member[.markupLevel], member[.markupBlockIndex]]]]]
else begin[{]
None
end[}]
return[member[.blockMatching]]
else begin[{]
None
end[}]
end[}]
return[literal[false]]
end[}]
END[}]
|
Keyword[boolean] identifier[matchXmlDeclaration] operator[SEP] Keyword[final] Keyword[boolean] identifier[blockMatching] , Keyword[final] Keyword[int] identifier[markupLevel] , Keyword[final] Keyword[int] identifier[markupBlockIndex] operator[SEP] {
identifier[checkMarkupLevel] operator[SEP] identifier[markupLevel] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[markupSelectorItem] operator[SEP] identifier[anyLevel] operator[SEP] operator[SEP] operator[||] identifier[markupLevel] operator[==] Other[0] operator[||] operator[SEP] Keyword[this] operator[SEP] identifier[prev] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[prev] operator[SEP] identifier[matchedMarkupLevels] operator[SEP] identifier[markupLevel] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[matchesThisLevel] operator[=] Keyword[this] operator[SEP] identifier[markupSelectorItem] operator[SEP] identifier[matchesXmlDeclaration] operator[SEP] identifier[markupBlockIndex] , Keyword[this] operator[SEP] identifier[markupBlockMatchingCounter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matchesPreviousOrCurrentLevel] operator[SEP] identifier[markupLevel] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[next] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[next] operator[SEP] identifier[matchXmlDeclaration] operator[SEP] identifier[blockMatching] , identifier[markupLevel] , identifier[markupBlockIndex] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[blockMatching] operator[?] literal[boolean] operator[:] Keyword[this] operator[SEP] identifier[matchesThisLevel] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[matchesThisLevel] operator[SEP] {
Keyword[return] operator[SEP] Keyword[this] operator[SEP] identifier[next] operator[==] Other[null] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[matchesPreviousOrCurrentLevel] operator[SEP] identifier[markupLevel] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[next] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[next] operator[SEP] identifier[matchXmlDeclaration] operator[SEP] identifier[blockMatching] , identifier[markupLevel] , identifier[markupBlockIndex] operator[SEP] operator[SEP]
}
Keyword[return] identifier[blockMatching] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private static void addFile(final File file, final File dirToZip, final ZipOutputStream zos)
throws IOException
{
final String absolutePath = file.getAbsolutePath();
final int index = absolutePath.indexOf(dirToZip.getName());
final String zipEntryName = absolutePath.substring(index, absolutePath.length());
final byte[] b = new byte[(int)file.length()];
final ZipEntry cpZipEntry = new ZipEntry(zipEntryName);
zos.putNextEntry(cpZipEntry);
zos.write(b, 0, (int)file.length());
zos.closeEntry();
}
|
class class_name[name] begin[{]
method[addFile, return_type[void], modifier[private static], parameter[file, dirToZip, zos]] begin[{]
local_variable[type[String], absolutePath]
local_variable[type[int], index]
local_variable[type[String], zipEntryName]
local_variable[type[byte], b]
local_variable[type[ZipEntry], cpZipEntry]
call[zos.putNextEntry, parameter[member[.cpZipEntry]]]
call[zos.write, parameter[member[.b], literal[0], Cast(expression=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]]
call[zos.closeEntry, parameter[]]
end[}]
END[}]
|
Keyword[private] Keyword[static] Keyword[void] identifier[addFile] operator[SEP] Keyword[final] identifier[File] identifier[file] , Keyword[final] identifier[File] identifier[dirToZip] , Keyword[final] identifier[ZipOutputStream] identifier[zos] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[String] identifier[absolutePath] operator[=] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[index] operator[=] identifier[absolutePath] operator[SEP] identifier[indexOf] operator[SEP] identifier[dirToZip] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[zipEntryName] operator[=] identifier[absolutePath] operator[SEP] identifier[substring] operator[SEP] identifier[index] , identifier[absolutePath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[=] Keyword[new] Keyword[byte] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[file] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ZipEntry] identifier[cpZipEntry] operator[=] Keyword[new] identifier[ZipEntry] operator[SEP] identifier[zipEntryName] operator[SEP] operator[SEP] identifier[zos] operator[SEP] identifier[putNextEntry] operator[SEP] identifier[cpZipEntry] operator[SEP] operator[SEP] identifier[zos] operator[SEP] identifier[write] operator[SEP] identifier[b] , Other[0] , operator[SEP] Keyword[int] operator[SEP] identifier[file] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[zos] operator[SEP] identifier[closeEntry] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public Object
read(List<Slice> slices)
throws DapException
{
switch (this.scheme) {
case ATOMIC:
return readAtomic(slices);
case STRUCTURE:
if(((DapVariable) this.getTemplate()).getRank() > 0
|| DapUtil.isScalarSlices(slices))
throw new DapException("Cannot slice a scalar variable");
CDMCursor[] instances = new CDMCursor[1];
instances[0] = this;
return instances;
case SEQUENCE:
if(((DapVariable) this.getTemplate()).getRank() > 0
|| DapUtil.isScalarSlices(slices))
throw new DapException("Cannot slice a scalar variable");
instances = new CDMCursor[1];
instances[0] = this;
return instances;
case STRUCTARRAY:
Odometer odom = Odometer.factory(slices);
instances = new CDMCursor[(int) odom.totalSize()];
for(int i = 0; odom.hasNext(); i++) {
instances[i] = readStructure(odom.next());
}
return instances;
case SEQARRAY:
instances = readSequence(slices);
return instances;
default:
throw new DapException("Attempt to slice a scalar object");
}
}
|
class class_name[name] begin[{]
method[read, return_type[type[Object]], modifier[public], parameter[slices]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['ATOMIC'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=slices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readAtomic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['STRUCTURE'], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getTemplate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=DapVariable, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=MethodInvocation(arguments=[MemberReference(member=slices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isScalarSlices, postfix_operators=[], prefix_operators=[], qualifier=DapUtil, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot slice a scalar variable")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DapException, sub_type=None)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDMCursor, sub_type=None)), name=instances)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=CDMCursor, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])), label=None), ReturnStatement(expression=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['SEQUENCE'], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getTemplate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=DapVariable, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=MethodInvocation(arguments=[MemberReference(member=slices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isScalarSlices, postfix_operators=[], prefix_operators=[], qualifier=DapUtil, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot slice a scalar variable")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DapException, sub_type=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDMCursor, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])), label=None), ReturnStatement(expression=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['STRUCTARRAY'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=slices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=factory, postfix_operators=[], prefix_operators=[], qualifier=Odometer, selectors=[], type_arguments=None), name=odom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Odometer, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[Cast(expression=MethodInvocation(arguments=[], member=totalSize, postfix_operators=[], prefix_operators=[], qualifier=odom, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDMCursor, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=odom, selectors=[], type_arguments=None)], member=readStructure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=odom, 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), ReturnStatement(expression=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=['SEQARRAY'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=slices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readSequence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attempt to slice a scalar object")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DapException, sub_type=None)), label=None)])], expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=scheme, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), label=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[read] operator[SEP] identifier[List] operator[<] identifier[Slice] operator[>] identifier[slices] operator[SEP] Keyword[throws] identifier[DapException] {
Keyword[switch] operator[SEP] Keyword[this] operator[SEP] identifier[scheme] operator[SEP] {
Keyword[case] identifier[ATOMIC] operator[:] Keyword[return] identifier[readAtomic] operator[SEP] identifier[slices] operator[SEP] operator[SEP] Keyword[case] identifier[STRUCTURE] operator[:] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[DapVariable] operator[SEP] Keyword[this] operator[SEP] identifier[getTemplate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getRank] operator[SEP] operator[SEP] operator[>] Other[0] operator[||] identifier[DapUtil] operator[SEP] identifier[isScalarSlices] operator[SEP] identifier[slices] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DapException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[CDMCursor] operator[SEP] operator[SEP] identifier[instances] operator[=] Keyword[new] identifier[CDMCursor] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[instances] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[this] operator[SEP] Keyword[return] identifier[instances] operator[SEP] Keyword[case] identifier[SEQUENCE] operator[:] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[DapVariable] operator[SEP] Keyword[this] operator[SEP] identifier[getTemplate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getRank] operator[SEP] operator[SEP] operator[>] Other[0] operator[||] identifier[DapUtil] operator[SEP] identifier[isScalarSlices] operator[SEP] identifier[slices] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DapException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[instances] operator[=] Keyword[new] identifier[CDMCursor] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[instances] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[this] operator[SEP] Keyword[return] identifier[instances] operator[SEP] Keyword[case] identifier[STRUCTARRAY] operator[:] identifier[Odometer] identifier[odom] operator[=] identifier[Odometer] operator[SEP] identifier[factory] operator[SEP] identifier[slices] operator[SEP] operator[SEP] identifier[instances] operator[=] Keyword[new] identifier[CDMCursor] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[odom] operator[SEP] identifier[totalSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[odom] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[instances] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[readStructure] operator[SEP] identifier[odom] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[instances] operator[SEP] Keyword[case] identifier[SEQARRAY] operator[:] identifier[instances] operator[=] identifier[readSequence] operator[SEP] identifier[slices] operator[SEP] operator[SEP] Keyword[return] identifier[instances] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[DapException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
protected void analyzeImpl(Analyzer analyzer, boolean allowFlow,
IntArray pendingTargets,
IntArray completedTargets)
throws Exception
{
setOffset(0);
pendingTargets.add(0);
ArrayList<CodeAttribute.ExceptionItem> exns;
exns = getExceptions();
for (int i = 0; i < exns.size(); i++) {
CodeAttribute.ExceptionItem exn = exns.get(i);
pendingTargets.add(exn.getHandler());
}
analyze(analyzer, allowFlow, pendingTargets, completedTargets);
}
|
class class_name[name] begin[{]
method[analyzeImpl, return_type[void], modifier[protected], parameter[analyzer, allowFlow, pendingTargets, completedTargets]] begin[{]
call[.setOffset, parameter[literal[0]]]
call[pendingTargets.add, parameter[literal[0]]]
local_variable[type[ArrayList], exns]
assign[member[.exns], call[.getExceptions, parameter[]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=exns, selectors=[], type_arguments=None), name=exn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CodeAttribute, sub_type=ReferenceType(arguments=None, dimensions=None, name=ExceptionItem, sub_type=None))), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHandler, postfix_operators=[], prefix_operators=[], qualifier=exn, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=pendingTargets, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=exns, 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)
call[.analyze, parameter[member[.analyzer], member[.allowFlow], member[.pendingTargets], member[.completedTargets]]]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[analyzeImpl] operator[SEP] identifier[Analyzer] identifier[analyzer] , Keyword[boolean] identifier[allowFlow] , identifier[IntArray] identifier[pendingTargets] , identifier[IntArray] identifier[completedTargets] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[setOffset] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[pendingTargets] operator[SEP] identifier[add] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[CodeAttribute] operator[SEP] identifier[ExceptionItem] operator[>] identifier[exns] operator[SEP] identifier[exns] operator[=] identifier[getExceptions] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[exns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[CodeAttribute] operator[SEP] identifier[ExceptionItem] identifier[exn] operator[=] identifier[exns] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[pendingTargets] operator[SEP] identifier[add] operator[SEP] identifier[exn] operator[SEP] identifier[getHandler] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[analyze] operator[SEP] identifier[analyzer] , identifier[allowFlow] , identifier[pendingTargets] , identifier[completedTargets] operator[SEP] operator[SEP]
}
|
private JPanel createFilterPane() {
JButton addButton = new JButton(edu.umd.cs.findbugs.L10N.getLocalString("dlg.add_dot_btn", "Add..."));
JButton removeButton = new JButton(edu.umd.cs.findbugs.L10N.getLocalString("dlg.remove_btn", "Remove"));
JButton removeAllButton = new JButton(edu.umd.cs.findbugs.L10N.getLocalString("dlg.remove_all_btn", "Remove All"));
JPanel filterPanel = new JPanel();
filterPanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridheight = 1;
gbc.gridwidth = 1;
gbc.gridx = 0;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.BOTH;
gbc.weightx = 1;
gbc.weighty = 1;
filterPanel.add(new JLabel("<HTML>These rules control which bugs are shown and which are hidden in this project"), gbc);
gbc.gridheight = 4;
gbc.gridwidth = 1;
gbc.gridx = 0;
gbc.gridy = 1;
gbc.fill = GridBagConstraints.BOTH;
gbc.weightx = 1;
gbc.weighty = 1;
filterPanel.add(new JScrollPane(filterCheckBoxList), gbc);
updateFilterPanel();
gbc.gridheight = 1;
gbc.gridx = 1;
gbc.gridy = 1;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 0;
gbc.weighty = 0;
filterPanel.add(addButton, gbc);
addButton.addActionListener(evt -> NewFilterFrame.open());
gbc.gridy = 2;
gbc.insets = new Insets(5, 0, 0, 0);
filterPanel.add(removeButton, gbc);
removeButton.addActionListener(evt -> {
List<MatchBox> selected = filterCheckBoxList.getSelectedValuesList();
if (selected.isEmpty()) {
return;
}
for (MatchBox box : selected) {
MainFrame.getInstance().getProject().getSuppressionFilter().removeChild(box.getMatcher());
}
FilterActivity.notifyListeners(FilterListener.Action.UNFILTERING, null);
MainFrame.getInstance().setProjectChanged(true);
updateFilterPanel();
});
gbc.gridy = 3;
gbc.weighty = 0;
gbc.insets = new Insets(5, 0, 0, 0);
filterPanel.add(removeAllButton, gbc);
removeAllButton.addActionListener(evt -> {
boolean needsRebuild = false;
Filter suppressionFilter = MainFrame.getInstance().getProject().getSuppressionFilter();
if (!suppressionFilter.isEmpty()) {
needsRebuild = true;
}
suppressionFilter.clear();
if (needsRebuild) {
// filters being cleared were disabled
FilterActivity.notifyListeners(FilterListener.Action.UNFILTERING, null);
}
MainFrame.getInstance().setProjectChanged(true);
updateFilterPanel();
});
gbc.gridy = 4;
gbc.weighty = 1;
gbc.insets = new Insets(0, 0, 0, 0);
filterPanel.add(Box.createGlue(), gbc);
return filterPanel;
}
|
class class_name[name] begin[{]
method[createFilterPane, return_type[type[JPanel]], modifier[private], parameter[]] begin[{]
local_variable[type[JButton], addButton]
local_variable[type[JButton], removeButton]
local_variable[type[JButton], removeAllButton]
local_variable[type[JPanel], filterPanel]
call[filterPanel.setLayout, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GridBagLayout, sub_type=None))]]
local_variable[type[GridBagConstraints], gbc]
assign[member[gbc.gridheight], literal[1]]
assign[member[gbc.gridwidth], literal[1]]
assign[member[gbc.gridx], literal[0]]
assign[member[gbc.gridy], literal[0]]
assign[member[gbc.fill], member[GridBagConstraints.BOTH]]
assign[member[gbc.weightx], literal[1]]
assign[member[gbc.weighty], literal[1]]
call[filterPanel.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<HTML>These rules control which bugs are shown and which are hidden in this project")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JLabel, sub_type=None)), member[.gbc]]]
assign[member[gbc.gridheight], literal[4]]
assign[member[gbc.gridwidth], literal[1]]
assign[member[gbc.gridx], literal[0]]
assign[member[gbc.gridy], literal[1]]
assign[member[gbc.fill], member[GridBagConstraints.BOTH]]
assign[member[gbc.weightx], literal[1]]
assign[member[gbc.weighty], literal[1]]
call[filterPanel.add, parameter[ClassCreator(arguments=[MemberReference(member=filterCheckBoxList, 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=JScrollPane, sub_type=None)), member[.gbc]]]
call[.updateFilterPanel, parameter[]]
assign[member[gbc.gridheight], literal[1]]
assign[member[gbc.gridx], literal[1]]
assign[member[gbc.gridy], literal[1]]
assign[member[gbc.fill], member[GridBagConstraints.HORIZONTAL]]
assign[member[gbc.weightx], literal[0]]
assign[member[gbc.weighty], literal[0]]
call[filterPanel.add, parameter[member[.addButton], member[.gbc]]]
call[addButton.addActionListener, parameter[LambdaExpression(body=MethodInvocation(arguments=[], member=open, postfix_operators=[], prefix_operators=[], qualifier=NewFilterFrame, selectors=[], type_arguments=None), parameters=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
assign[member[gbc.gridy], literal[2]]
assign[member[gbc.insets], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Insets, sub_type=None))]
call[filterPanel.add, parameter[member[.removeButton], member[.gbc]]]
call[removeButton.addActionListener, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSelectedValuesList, postfix_operators=[], prefix_operators=[], qualifier=filterCheckBoxList, selectors=[], type_arguments=None), name=selected)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MatchBox, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=selected, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MainFrame, selectors=[MethodInvocation(arguments=[], member=getProject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getSuppressionFilter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMatcher, postfix_operators=[], prefix_operators=[], qualifier=box, selectors=[], type_arguments=None)], member=removeChild, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=selected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=box)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MatchBox, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=UNFILTERING, postfix_operators=[], prefix_operators=[], qualifier=FilterListener.Action, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=notifyListeners, postfix_operators=[], prefix_operators=[], qualifier=FilterActivity, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MainFrame, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setProjectChanged, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=updateFilterPanel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], parameters=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
assign[member[gbc.gridy], literal[3]]
assign[member[gbc.weighty], literal[0]]
assign[member[gbc.insets], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Insets, sub_type=None))]
call[filterPanel.add, parameter[member[.removeAllButton], member[.gbc]]]
call[removeAllButton.addActionListener, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=needsRebuild)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MainFrame, selectors=[MethodInvocation(arguments=[], member=getProject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getSuppressionFilter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=suppressionFilter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Filter, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=suppressionFilter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=needsRebuild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=suppressionFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=needsRebuild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=UNFILTERING, postfix_operators=[], prefix_operators=[], qualifier=FilterListener.Action, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=notifyListeners, postfix_operators=[], prefix_operators=[], qualifier=FilterActivity, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MainFrame, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setProjectChanged, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=updateFilterPanel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], parameters=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
assign[member[gbc.gridy], literal[4]]
assign[member[gbc.weighty], literal[1]]
assign[member[gbc.insets], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Insets, sub_type=None))]
call[filterPanel.add, parameter[call[Box.createGlue, parameter[]], member[.gbc]]]
return[member[.filterPanel]]
end[}]
END[}]
|
Keyword[private] identifier[JPanel] identifier[createFilterPane] operator[SEP] operator[SEP] {
identifier[JButton] identifier[addButton] operator[=] Keyword[new] identifier[JButton] operator[SEP] identifier[edu] operator[SEP] identifier[umd] operator[SEP] identifier[cs] operator[SEP] identifier[findbugs] operator[SEP] identifier[L10N] operator[SEP] identifier[getLocalString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[JButton] identifier[removeButton] operator[=] Keyword[new] identifier[JButton] operator[SEP] identifier[edu] operator[SEP] identifier[umd] operator[SEP] identifier[cs] operator[SEP] identifier[findbugs] operator[SEP] identifier[L10N] operator[SEP] identifier[getLocalString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[JButton] identifier[removeAllButton] operator[=] Keyword[new] identifier[JButton] operator[SEP] identifier[edu] operator[SEP] identifier[umd] operator[SEP] identifier[cs] operator[SEP] identifier[findbugs] operator[SEP] identifier[L10N] operator[SEP] identifier[getLocalString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[JPanel] identifier[filterPanel] operator[=] Keyword[new] identifier[JPanel] operator[SEP] operator[SEP] operator[SEP] identifier[filterPanel] operator[SEP] identifier[setLayout] operator[SEP] Keyword[new] identifier[GridBagLayout] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[GridBagConstraints] identifier[gbc] operator[=] Keyword[new] identifier[GridBagConstraints] operator[SEP] operator[SEP] operator[SEP] identifier[gbc] operator[SEP] identifier[gridheight] operator[=] Other[1] operator[SEP] identifier[gbc] operator[SEP] identifier[gridwidth] operator[=] Other[1] operator[SEP] identifier[gbc] operator[SEP] identifier[gridx] operator[=] Other[0] operator[SEP] identifier[gbc] operator[SEP] identifier[gridy] operator[=] Other[0] operator[SEP] identifier[gbc] operator[SEP] identifier[fill] operator[=] identifier[GridBagConstraints] operator[SEP] identifier[BOTH] operator[SEP] identifier[gbc] operator[SEP] identifier[weightx] operator[=] Other[1] operator[SEP] identifier[gbc] operator[SEP] identifier[weighty] operator[=] Other[1] operator[SEP] identifier[filterPanel] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[JLabel] operator[SEP] literal[String] operator[SEP] , identifier[gbc] operator[SEP] operator[SEP] identifier[gbc] operator[SEP] identifier[gridheight] operator[=] Other[4] operator[SEP] identifier[gbc] operator[SEP] identifier[gridwidth] operator[=] Other[1] operator[SEP] identifier[gbc] operator[SEP] identifier[gridx] operator[=] Other[0] operator[SEP] identifier[gbc] operator[SEP] identifier[gridy] operator[=] Other[1] operator[SEP] identifier[gbc] operator[SEP] identifier[fill] operator[=] identifier[GridBagConstraints] operator[SEP] identifier[BOTH] operator[SEP] identifier[gbc] operator[SEP] identifier[weightx] operator[=] Other[1] operator[SEP] identifier[gbc] operator[SEP] identifier[weighty] operator[=] Other[1] operator[SEP] identifier[filterPanel] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[JScrollPane] operator[SEP] identifier[filterCheckBoxList] operator[SEP] , identifier[gbc] operator[SEP] operator[SEP] identifier[updateFilterPanel] operator[SEP] operator[SEP] operator[SEP] identifier[gbc] operator[SEP] identifier[gridheight] operator[=] Other[1] operator[SEP] identifier[gbc] operator[SEP] identifier[gridx] operator[=] Other[1] operator[SEP] identifier[gbc] operator[SEP] identifier[gridy] operator[=] Other[1] operator[SEP] identifier[gbc] operator[SEP] identifier[fill] operator[=] identifier[GridBagConstraints] operator[SEP] identifier[HORIZONTAL] operator[SEP] identifier[gbc] operator[SEP] identifier[weightx] operator[=] Other[0] operator[SEP] identifier[gbc] operator[SEP] identifier[weighty] operator[=] Other[0] operator[SEP] identifier[filterPanel] operator[SEP] identifier[add] operator[SEP] identifier[addButton] , identifier[gbc] operator[SEP] operator[SEP] identifier[addButton] operator[SEP] identifier[addActionListener] operator[SEP] identifier[evt] operator[->] identifier[NewFilterFrame] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[gbc] operator[SEP] identifier[gridy] operator[=] Other[2] operator[SEP] identifier[gbc] operator[SEP] identifier[insets] operator[=] Keyword[new] identifier[Insets] operator[SEP] Other[5] , Other[0] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[filterPanel] operator[SEP] identifier[add] operator[SEP] identifier[removeButton] , identifier[gbc] operator[SEP] operator[SEP] identifier[removeButton] operator[SEP] identifier[addActionListener] operator[SEP] identifier[evt] operator[->] {
identifier[List] operator[<] identifier[MatchBox] operator[>] identifier[selected] operator[=] identifier[filterCheckBoxList] operator[SEP] identifier[getSelectedValuesList] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selected] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[for] operator[SEP] identifier[MatchBox] identifier[box] operator[:] identifier[selected] operator[SEP] {
identifier[MainFrame] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] operator[SEP] identifier[getSuppressionFilter] operator[SEP] operator[SEP] operator[SEP] identifier[removeChild] operator[SEP] identifier[box] operator[SEP] identifier[getMatcher] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[FilterActivity] operator[SEP] identifier[notifyListeners] operator[SEP] identifier[FilterListener] operator[SEP] identifier[Action] operator[SEP] identifier[UNFILTERING] , Other[null] operator[SEP] operator[SEP] identifier[MainFrame] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[setProjectChanged] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[updateFilterPanel] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] identifier[gbc] operator[SEP] identifier[gridy] operator[=] Other[3] operator[SEP] identifier[gbc] operator[SEP] identifier[weighty] operator[=] Other[0] operator[SEP] identifier[gbc] operator[SEP] identifier[insets] operator[=] Keyword[new] identifier[Insets] operator[SEP] Other[5] , Other[0] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[filterPanel] operator[SEP] identifier[add] operator[SEP] identifier[removeAllButton] , identifier[gbc] operator[SEP] operator[SEP] identifier[removeAllButton] operator[SEP] identifier[addActionListener] operator[SEP] identifier[evt] operator[->] {
Keyword[boolean] identifier[needsRebuild] operator[=] literal[boolean] operator[SEP] identifier[Filter] identifier[suppressionFilter] operator[=] identifier[MainFrame] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] operator[SEP] identifier[getSuppressionFilter] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[suppressionFilter] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[needsRebuild] operator[=] literal[boolean] operator[SEP]
}
identifier[suppressionFilter] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[needsRebuild] operator[SEP] {
identifier[FilterActivity] operator[SEP] identifier[notifyListeners] operator[SEP] identifier[FilterListener] operator[SEP] identifier[Action] operator[SEP] identifier[UNFILTERING] , Other[null] operator[SEP] operator[SEP]
}
identifier[MainFrame] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[setProjectChanged] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[updateFilterPanel] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] identifier[gbc] operator[SEP] identifier[gridy] operator[=] Other[4] operator[SEP] identifier[gbc] operator[SEP] identifier[weighty] operator[=] Other[1] operator[SEP] identifier[gbc] operator[SEP] identifier[insets] operator[=] Keyword[new] identifier[Insets] operator[SEP] Other[0] , Other[0] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[filterPanel] operator[SEP] identifier[add] operator[SEP] identifier[Box] operator[SEP] identifier[createGlue] operator[SEP] operator[SEP] , identifier[gbc] operator[SEP] operator[SEP] Keyword[return] identifier[filterPanel] operator[SEP]
}
|
public MultiPolylineMarkers addMultiPolylineToMapAsMarkers(
GoogleMapShapeMarkers shapeMarkers, GoogleMap map,
MultiPolylineOptions multiPolyline,
MarkerOptions polylineMarkerOptions,
PolylineOptions globalPolylineOptions) {
MultiPolylineMarkers polylines = new MultiPolylineMarkers();
for (PolylineOptions polylineOptions : multiPolyline
.getPolylineOptions()) {
PolylineMarkers polylineMarker = addPolylineToMapAsMarkers(map,
polylineOptions, polylineMarkerOptions,
globalPolylineOptions);
shapeMarkers.add(polylineMarker);
polylines.add(polylineMarker);
}
return polylines;
}
|
class class_name[name] begin[{]
method[addMultiPolylineToMapAsMarkers, return_type[type[MultiPolylineMarkers]], modifier[public], parameter[shapeMarkers, map, multiPolyline, polylineMarkerOptions, globalPolylineOptions]] begin[{]
local_variable[type[MultiPolylineMarkers], polylines]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=polylineOptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=polylineMarkerOptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=globalPolylineOptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPolylineToMapAsMarkers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=polylineMarker)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PolylineMarkers, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=polylineMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=shapeMarkers, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=polylineMarker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=polylines, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPolylineOptions, postfix_operators=[], prefix_operators=[], qualifier=multiPolyline, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=polylineOptions)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PolylineOptions, sub_type=None))), label=None)
return[member[.polylines]]
end[}]
END[}]
|
Keyword[public] identifier[MultiPolylineMarkers] identifier[addMultiPolylineToMapAsMarkers] operator[SEP] identifier[GoogleMapShapeMarkers] identifier[shapeMarkers] , identifier[GoogleMap] identifier[map] , identifier[MultiPolylineOptions] identifier[multiPolyline] , identifier[MarkerOptions] identifier[polylineMarkerOptions] , identifier[PolylineOptions] identifier[globalPolylineOptions] operator[SEP] {
identifier[MultiPolylineMarkers] identifier[polylines] operator[=] Keyword[new] identifier[MultiPolylineMarkers] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PolylineOptions] identifier[polylineOptions] operator[:] identifier[multiPolyline] operator[SEP] identifier[getPolylineOptions] operator[SEP] operator[SEP] operator[SEP] {
identifier[PolylineMarkers] identifier[polylineMarker] operator[=] identifier[addPolylineToMapAsMarkers] operator[SEP] identifier[map] , identifier[polylineOptions] , identifier[polylineMarkerOptions] , identifier[globalPolylineOptions] operator[SEP] operator[SEP] identifier[shapeMarkers] operator[SEP] identifier[add] operator[SEP] identifier[polylineMarker] operator[SEP] operator[SEP] identifier[polylines] operator[SEP] identifier[add] operator[SEP] identifier[polylineMarker] operator[SEP] operator[SEP]
}
Keyword[return] identifier[polylines] operator[SEP]
}
|
public static UnionTerminal distinct() {
UnionTerminal ret = UnionFactory.distinct();
ASTNode an = APIObjectAccess.getAstNode(ret);
an.setClauseType(ClauseType.UNION);
return ret;
}
|
class class_name[name] begin[{]
method[distinct, return_type[type[UnionTerminal]], modifier[public static], parameter[]] begin[{]
local_variable[type[UnionTerminal], ret]
local_variable[type[ASTNode], an]
call[an.setClauseType, parameter[member[ClauseType.UNION]]]
return[member[.ret]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[UnionTerminal] identifier[distinct] operator[SEP] operator[SEP] {
identifier[UnionTerminal] identifier[ret] operator[=] identifier[UnionFactory] operator[SEP] identifier[distinct] operator[SEP] operator[SEP] operator[SEP] identifier[ASTNode] identifier[an] operator[=] identifier[APIObjectAccess] operator[SEP] identifier[getAstNode] operator[SEP] identifier[ret] operator[SEP] operator[SEP] identifier[an] operator[SEP] identifier[setClauseType] operator[SEP] identifier[ClauseType] operator[SEP] identifier[UNION] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP]
}
|
public String next() {
if (entry == null) return null;
entry = entry.next;
return entry.element;
}
|
class class_name[name] begin[{]
method[next, return_type[type[String]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.entry], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
assign[member[.entry], member[entry.next]]
return[member[entry.element]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[next] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[entry] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[entry] operator[=] identifier[entry] operator[SEP] identifier[next] operator[SEP] Keyword[return] identifier[entry] operator[SEP] identifier[element] operator[SEP]
}
|
@SuppressWarnings("null")
private boolean accepts(SlingHttpServletRequest request) {
return request.getMethod().equalsIgnoreCase(METHOD_GET)
&& request.getResource() != null
&& StringUtils.equals(request.getResource().getValueMap().get(JCR_PRIMARYTYPE, String.class), NT_FILE);
}
|
class class_name[name] begin[{]
method[accepts, return_type[type[boolean]], modifier[private], parameter[request]] begin[{]
return[binary_operation[binary_operation[call[request.getMethod, parameter[]], &&, binary_operation[call[request.getResource, parameter[]], !=, literal[null]]], &&, call[StringUtils.equals, parameter[call[request.getResource, parameter[]], member[.NT_FILE]]]]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[boolean] identifier[accepts] operator[SEP] identifier[SlingHttpServletRequest] identifier[request] operator[SEP] {
Keyword[return] identifier[request] operator[SEP] identifier[getMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[METHOD_GET] operator[SEP] operator[&&] identifier[request] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[StringUtils] operator[SEP] identifier[equals] operator[SEP] identifier[request] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] identifier[getValueMap] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[JCR_PRIMARYTYPE] , identifier[String] operator[SEP] Keyword[class] operator[SEP] , identifier[NT_FILE] operator[SEP] operator[SEP]
}
|
public static RequestResponse callHttpPatch(HttpJsonRpcClient client, String url,
Map<String, Object> headers, Map<String, Object> urlParams, Object requestData) {
return client.doPatch(url, headers, urlParams, requestData);
}
|
class class_name[name] begin[{]
method[callHttpPatch, return_type[type[RequestResponse]], modifier[public static], parameter[client, url, headers, urlParams, requestData]] begin[{]
return[call[client.doPatch, parameter[member[.url], member[.headers], member[.urlParams], member[.requestData]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[RequestResponse] identifier[callHttpPatch] operator[SEP] identifier[HttpJsonRpcClient] identifier[client] , identifier[String] identifier[url] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[headers] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[urlParams] , identifier[Object] identifier[requestData] operator[SEP] {
Keyword[return] identifier[client] operator[SEP] identifier[doPatch] operator[SEP] identifier[url] , identifier[headers] , identifier[urlParams] , identifier[requestData] operator[SEP] operator[SEP]
}
|
public void marshall(ApplicationCodeConfigurationDescription applicationCodeConfigurationDescription, ProtocolMarshaller protocolMarshaller) {
if (applicationCodeConfigurationDescription == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(applicationCodeConfigurationDescription.getCodeContentType(), CODECONTENTTYPE_BINDING);
protocolMarshaller.marshall(applicationCodeConfigurationDescription.getCodeContentDescription(), CODECONTENTDESCRIPTION_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[applicationCodeConfigurationDescription, protocolMarshaller]] begin[{]
if[binary_operation[member[.applicationCodeConfigurationDescription], ==, 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=getCodeContentType, postfix_operators=[], prefix_operators=[], qualifier=applicationCodeConfigurationDescription, selectors=[], type_arguments=None), MemberReference(member=CODECONTENTTYPE_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=getCodeContentDescription, postfix_operators=[], prefix_operators=[], qualifier=applicationCodeConfigurationDescription, selectors=[], type_arguments=None), MemberReference(member=CODECONTENTDESCRIPTION_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[ApplicationCodeConfigurationDescription] identifier[applicationCodeConfigurationDescription] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[applicationCodeConfigurationDescription] 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[applicationCodeConfigurationDescription] operator[SEP] identifier[getCodeContentType] operator[SEP] operator[SEP] , identifier[CODECONTENTTYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[applicationCodeConfigurationDescription] operator[SEP] identifier[getCodeContentDescription] operator[SEP] operator[SEP] , identifier[CODECONTENTDESCRIPTION_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
protected boolean findOUColumn(CmsSetupDb dbCon, String table, String ouColumn) {
System.out.println(new Exception().getStackTrace()[0].toString());
return dbCon.hasTableOrColumn(table, ouColumn);
}
|
class class_name[name] begin[{]
method[findOUColumn, return_type[type[boolean]], modifier[protected], parameter[dbCon, table, ouColumn]] begin[{]
call[System.out.println, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getStackTrace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None))]]
return[call[dbCon.hasTableOrColumn, parameter[member[.table], member[.ouColumn]]]]
end[}]
END[}]
|
Keyword[protected] Keyword[boolean] identifier[findOUColumn] operator[SEP] identifier[CmsSetupDb] identifier[dbCon] , identifier[String] identifier[table] , identifier[String] identifier[ouColumn] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] Keyword[new] identifier[Exception] operator[SEP] operator[SEP] operator[SEP] identifier[getStackTrace] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dbCon] operator[SEP] identifier[hasTableOrColumn] operator[SEP] identifier[table] , identifier[ouColumn] operator[SEP] operator[SEP]
}
|
public DeployableUnitImpl build(String url, File deploymentRoot,
ComponentRepository componentRepository)
throws DeploymentException, AlreadyDeployedException,
MalformedURLException {
if (logger.isDebugEnabled()) {
logger.debug("Building DU from " + url);
}
DeployableUnitID deployableUnitID = new DeployableUnitID(url);
if (deploymentRoot == null) {
throw new NullPointerException("null deploymentRoot");
}
URL sourceUrl = new URL(url);
// support remote deployment
if(sourceUrl.getProtocol().equals("http") || sourceUrl.getProtocol().equals("https")) {
try {
// Fetch the remote file to a temporary location
File downloadedFile = downloadRemoteDU(sourceUrl, deploymentRoot);
// Update the pointers from URL and String
sourceUrl = downloadedFile.toURI().toURL();
url = sourceUrl.toString();
}
catch (Exception e) {
throw new DeploymentException("Failed to retrieve remote DU file : " + sourceUrl.getFile(), e);
}
}
// create jar file
JarFile deployableUnitJar = null;
try {
deployableUnitJar = new JarFile(sourceUrl.getFile());
} catch (IOException e) {
throw new DeploymentException(
"Failed to open DU file as JAR file: "
+ sourceUrl.getFile(), e);
}
// get and parse du descriptor
JarEntry duXmlEntry = deployableUnitJar
.getJarEntry("META-INF/deployable-unit.xml");
if (duXmlEntry == null) {
throw new DeploymentException(
"META-INF/deployable-unit.xml was not found in "
+ deployableUnitJar.getName());
}
DeployableUnitDescriptorFactoryImpl descriptorFactory = componentManagement.getComponentDescriptorFactory().getDeployableUnitDescriptorFactory();
DeployableUnitDescriptorImpl deployableUnitDescriptor = null;
try {
deployableUnitDescriptor = descriptorFactory
.parse(deployableUnitJar.getInputStream(duXmlEntry));
} catch (IOException e) {
try {
deployableUnitJar.close();
} catch (IOException e1) {
logger.error(e.getMessage(), e);
}
throw new DeploymentException(
"Failed to get DU descriptor DU inputstream from JAR file "
+ sourceUrl.getFile(), e);
}
// create the du dir
File deploymentDir = createTempDUDeploymentDir(deploymentRoot,
deployableUnitID);
// build du object
DeployableUnitImpl deployableUnit = null;
try {
deployableUnit = new DeployableUnitImpl(deployableUnitID,
deployableUnitDescriptor, componentRepository,
deploymentDir);
// build each du jar component
for (String jarFileName : deployableUnitDescriptor.getJarEntries()) {
for (SleeComponent sleeComponent : duComponentBuilder
.buildComponents(jarFileName, deployableUnitJar,
deployableUnit.getDeploymentDir())) {
sleeComponent.setDeployableUnit(deployableUnit);
if (componentRepository.isInstalled(sleeComponent
.getComponentID())) {
throw new AlreadyDeployedException("Component "
+ sleeComponent.getComponentID()
+ " already deployed");
}
sleeComponent.setDeploymentUnitSource(jarFileName);
}
}
// build each du service component
for (String serviceDescriptorFileName : deployableUnitDescriptor
.getServiceEntries()) {
for (ServiceComponentImpl serviceComponent : duServiceComponentBuilder
.buildComponents(serviceDescriptorFileName,
deployableUnitJar)) {
serviceComponent.setDeployableUnit(deployableUnit);
if (componentRepository.isInstalled(serviceComponent
.getComponentID())) {
throw new AlreadyDeployedException("Component "
+ serviceComponent.getComponentID()
+ " already deployed");
}
// set the direct reference to the sbb component
serviceComponent.setRootSbbComponent(deployableUnit
.getDeployableUnitRepository().getComponentByID(
serviceComponent.getDescriptor()
.getRootSbbID()));
serviceComponent
.setDeploymentUnitSource(serviceDescriptorFileName);
}
}
// get a set with all components of the DU
Set<SleeComponent> duComponentsSet = deployableUnit
.getDeployableUnitComponents();
// now that all components are built we need to
for (SleeComponent sleeComponent : duComponentsSet) {
// check if all
// dependencies are available
checkDependencies(sleeComponent, deployableUnit);
// build its class loader
createClassLoader((AbstractSleeComponent) sleeComponent);
}
// load the provided classes for the component
for (SleeComponent sleeComponent : duComponentsSet) {
loadAndSetNonGeneratedComponentClasses((AbstractSleeComponent) sleeComponent);
}
//boolean secEnabled = SleeContainer.isSecurityEnabled();
// validate each component
for (SleeComponent sleeComponent : duComponentsSet) {
ClassLoader componentClassLoader = sleeComponent
.getClassLoader();
ClassLoader oldClassLoader = Thread.currentThread()
.getContextClassLoader();
try {
if (componentClassLoader != null) {
Thread.currentThread().setContextClassLoader(
componentClassLoader);
}
if (logger.isDebugEnabled()) {
logger.debug("Validating " + sleeComponent);
}
if (!sleeComponent.validate()) {
throw new DeploymentException(
sleeComponent.toString()
+ " validation failed, check logs for errors found");
}
//Make permissions object, this instruments codebase etc, and store POJOs in component.
//if(secEnabled)
//{
sleeComponent.processSecurityPermissions();
//}
} catch (Throwable e) {
throw new DeploymentException("failed to validate "
+ sleeComponent, e);
} finally {
if (componentClassLoader != null) {
Thread.currentThread().setContextClassLoader(
oldClassLoader);
}
}
}
try {
deployableUnitJar.close();
} catch (IOException e) {
logger.error("failed to close deployable jar from " + url, e);
}
return deployableUnit;
} catch (Throwable e) {
if (deployableUnit == null) {
if (logger.isDebugEnabled()) {
logger.debug("Deleting deployable unit temp dir "
+ deploymentDir);
}
deploymentDir.delete();
}
if (e instanceof DeploymentException) {
throw (DeploymentException) e;
} else if (e instanceof AlreadyDeployedException) {
throw (AlreadyDeployedException) e;
} else {
throw new DeploymentException(
"failed to build deployable unit", e);
}
}
}
|
class class_name[name] begin[{]
method[build, return_type[type[DeployableUnitImpl]], modifier[public], parameter[url, deploymentRoot, componentRepository]] begin[{]
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[binary_operation[literal["Building DU from "], +, member[.url]]]]
else begin[{]
None
end[}]
local_variable[type[DeployableUnitID], deployableUnitID]
if[binary_operation[member[.deploymentRoot], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null deploymentRoot")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[URL], sourceUrl]
if[binary_operation[call[sourceUrl.getProtocol, parameter[]], ||, call[sourceUrl.getProtocol, parameter[]]]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sourceUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deploymentRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=downloadRemoteDU, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=downloadedFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sourceUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=downloadedFile, selectors=[MethodInvocation(arguments=[], member=toURL, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sourceUrl, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to retrieve remote DU file : "), operandr=MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=sourceUrl, 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=DeploymentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
local_variable[type[JarFile], deployableUnitJar]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=deployableUnitJar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=sourceUrl, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JarFile, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to open DU file as JAR file: "), operandr=MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=sourceUrl, 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=DeploymentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
local_variable[type[JarEntry], duXmlEntry]
if[binary_operation[member[.duXmlEntry], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="META-INF/deployable-unit.xml was not found in "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=deployableUnitJar, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DeploymentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[DeployableUnitDescriptorFactoryImpl], descriptorFactory]
local_variable[type[DeployableUnitDescriptorImpl], deployableUnitDescriptor]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=deployableUnitDescriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=duXmlEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=deployableUnitJar, selectors=[], type_arguments=None)], member=parse, postfix_operators=[], prefix_operators=[], qualifier=descriptorFactory, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=deployableUnitJar, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['IOException']))], finally_block=None, label=None, resources=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to get DU descriptor DU inputstream from JAR file "), operandr=MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=sourceUrl, 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=DeploymentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
local_variable[type[File], deploymentDir]
local_variable[type[DeployableUnitImpl], deployableUnit]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=deployableUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=deployableUnitID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deployableUnitDescriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=componentRepository, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deploymentDir, 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=DeployableUnitImpl, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=deployableUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDeployableUnit, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None)], member=isInstalled, postfix_operators=[], prefix_operators=[], qualifier=componentRepository, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component "), operandr=MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" already deployed"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AlreadyDeployedException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=jarFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDeploymentUnitSource, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=jarFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deployableUnitJar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getDeploymentDir, postfix_operators=[], prefix_operators=[], qualifier=deployableUnit, selectors=[], type_arguments=None)], member=buildComponents, postfix_operators=[], prefix_operators=[], qualifier=duComponentBuilder, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sleeComponent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SleeComponent, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getJarEntries, postfix_operators=[], prefix_operators=[], qualifier=deployableUnitDescriptor, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=jarFileName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=deployableUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDeployableUnit, postfix_operators=[], prefix_operators=[], qualifier=serviceComponent, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=serviceComponent, selectors=[], type_arguments=None)], member=isInstalled, postfix_operators=[], prefix_operators=[], qualifier=componentRepository, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Component "), operandr=MethodInvocation(arguments=[], member=getComponentID, postfix_operators=[], prefix_operators=[], qualifier=serviceComponent, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" already deployed"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AlreadyDeployedException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDeployableUnitRepository, postfix_operators=[], prefix_operators=[], qualifier=deployableUnit, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDescriptor, postfix_operators=[], prefix_operators=[], qualifier=serviceComponent, selectors=[MethodInvocation(arguments=[], member=getRootSbbID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getComponentByID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setRootSbbComponent, postfix_operators=[], prefix_operators=[], qualifier=serviceComponent, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=serviceDescriptorFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDeploymentUnitSource, postfix_operators=[], prefix_operators=[], qualifier=serviceComponent, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=serviceDescriptorFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deployableUnitJar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildComponents, postfix_operators=[], prefix_operators=[], qualifier=duServiceComponentBuilder, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=serviceComponent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServiceComponentImpl, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getServiceEntries, postfix_operators=[], prefix_operators=[], qualifier=deployableUnitDescriptor, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=serviceDescriptorFileName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDeployableUnitComponents, postfix_operators=[], prefix_operators=[], qualifier=deployableUnit, selectors=[], type_arguments=None), name=duComponentsSet)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SleeComponent, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sleeComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deployableUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkDependencies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=sleeComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractSleeComponent, sub_type=None))], member=createClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=duComponentsSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sleeComponent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SleeComponent, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=sleeComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractSleeComponent, sub_type=None))], member=loadAndSetNonGeneratedComponentClasses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=duComponentsSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sleeComponent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SleeComponent, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), name=componentClassLoader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=getContextClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=oldClassLoader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None)), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=componentClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[MemberReference(member=componentClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContextClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Validating "), operandr=MemberReference(member=sleeComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=validate, postfix_operators=[], prefix_operators=['!'], qualifier=sleeComponent, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" validation failed, check logs for errors found"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DeploymentException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=processSecurityPermissions, postfix_operators=[], prefix_operators=[], qualifier=sleeComponent, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failed to validate "), operandr=MemberReference(member=sleeComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=DeploymentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=componentClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[MemberReference(member=oldClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContextClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=duComponentsSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sleeComponent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SleeComponent, sub_type=None))), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=deployableUnitJar, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failed to close deployable jar from "), operandr=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None), ReturnStatement(expression=MemberReference(member=deployableUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=deployableUnit, 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=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Deleting deployable unit temp dir "), operandr=MemberReference(member=deploymentDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=[], qualifier=deploymentDir, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=DeploymentException, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=AlreadyDeployedException, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failed to build deployable unit"), 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=DeploymentException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AlreadyDeployedException, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DeploymentException, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] identifier[DeployableUnitImpl] identifier[build] operator[SEP] identifier[String] identifier[url] , identifier[File] identifier[deploymentRoot] , identifier[ComponentRepository] identifier[componentRepository] operator[SEP] Keyword[throws] identifier[DeploymentException] , identifier[AlreadyDeployedException] , identifier[MalformedURLException] {
Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[url] operator[SEP] operator[SEP]
}
identifier[DeployableUnitID] identifier[deployableUnitID] operator[=] Keyword[new] identifier[DeployableUnitID] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deploymentRoot] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[URL] identifier[sourceUrl] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sourceUrl] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[sourceUrl] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[File] identifier[downloadedFile] operator[=] identifier[downloadRemoteDU] operator[SEP] identifier[sourceUrl] , identifier[deploymentRoot] operator[SEP] operator[SEP] identifier[sourceUrl] operator[=] identifier[downloadedFile] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[toURL] operator[SEP] operator[SEP] operator[SEP] identifier[url] operator[=] identifier[sourceUrl] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DeploymentException] operator[SEP] literal[String] operator[+] identifier[sourceUrl] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
identifier[JarFile] identifier[deployableUnitJar] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[deployableUnitJar] operator[=] Keyword[new] identifier[JarFile] operator[SEP] identifier[sourceUrl] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DeploymentException] operator[SEP] literal[String] operator[+] identifier[sourceUrl] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
identifier[JarEntry] identifier[duXmlEntry] operator[=] identifier[deployableUnitJar] operator[SEP] identifier[getJarEntry] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[duXmlEntry] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DeploymentException] operator[SEP] literal[String] operator[+] identifier[deployableUnitJar] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[DeployableUnitDescriptorFactoryImpl] identifier[descriptorFactory] operator[=] identifier[componentManagement] operator[SEP] identifier[getComponentDescriptorFactory] operator[SEP] operator[SEP] operator[SEP] identifier[getDeployableUnitDescriptorFactory] operator[SEP] operator[SEP] operator[SEP] identifier[DeployableUnitDescriptorImpl] identifier[deployableUnitDescriptor] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[deployableUnitDescriptor] operator[=] identifier[descriptorFactory] operator[SEP] identifier[parse] operator[SEP] identifier[deployableUnitJar] operator[SEP] identifier[getInputStream] operator[SEP] identifier[duXmlEntry] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[try] {
identifier[deployableUnitJar] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e1] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[DeploymentException] operator[SEP] literal[String] operator[+] identifier[sourceUrl] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
identifier[File] identifier[deploymentDir] operator[=] identifier[createTempDUDeploymentDir] operator[SEP] identifier[deploymentRoot] , identifier[deployableUnitID] operator[SEP] operator[SEP] identifier[DeployableUnitImpl] identifier[deployableUnit] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[deployableUnit] operator[=] Keyword[new] identifier[DeployableUnitImpl] operator[SEP] identifier[deployableUnitID] , identifier[deployableUnitDescriptor] , identifier[componentRepository] , identifier[deploymentDir] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[jarFileName] operator[:] identifier[deployableUnitDescriptor] operator[SEP] identifier[getJarEntries] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[SleeComponent] identifier[sleeComponent] operator[:] identifier[duComponentBuilder] operator[SEP] identifier[buildComponents] operator[SEP] identifier[jarFileName] , identifier[deployableUnitJar] , identifier[deployableUnit] operator[SEP] identifier[getDeploymentDir] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[sleeComponent] operator[SEP] identifier[setDeployableUnit] operator[SEP] identifier[deployableUnit] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[componentRepository] operator[SEP] identifier[isInstalled] operator[SEP] identifier[sleeComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AlreadyDeployedException] operator[SEP] literal[String] operator[+] identifier[sleeComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[sleeComponent] operator[SEP] identifier[setDeploymentUnitSource] operator[SEP] identifier[jarFileName] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] identifier[String] identifier[serviceDescriptorFileName] operator[:] identifier[deployableUnitDescriptor] operator[SEP] identifier[getServiceEntries] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[ServiceComponentImpl] identifier[serviceComponent] operator[:] identifier[duServiceComponentBuilder] operator[SEP] identifier[buildComponents] operator[SEP] identifier[serviceDescriptorFileName] , identifier[deployableUnitJar] operator[SEP] operator[SEP] {
identifier[serviceComponent] operator[SEP] identifier[setDeployableUnit] operator[SEP] identifier[deployableUnit] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[componentRepository] operator[SEP] identifier[isInstalled] operator[SEP] identifier[serviceComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AlreadyDeployedException] operator[SEP] literal[String] operator[+] identifier[serviceComponent] operator[SEP] identifier[getComponentID] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[serviceComponent] operator[SEP] identifier[setRootSbbComponent] operator[SEP] identifier[deployableUnit] operator[SEP] identifier[getDeployableUnitRepository] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentByID] operator[SEP] identifier[serviceComponent] operator[SEP] identifier[getDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[getRootSbbID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[serviceComponent] operator[SEP] identifier[setDeploymentUnitSource] operator[SEP] identifier[serviceDescriptorFileName] operator[SEP] operator[SEP]
}
}
identifier[Set] operator[<] identifier[SleeComponent] operator[>] identifier[duComponentsSet] operator[=] identifier[deployableUnit] operator[SEP] identifier[getDeployableUnitComponents] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SleeComponent] identifier[sleeComponent] operator[:] identifier[duComponentsSet] operator[SEP] {
identifier[checkDependencies] operator[SEP] identifier[sleeComponent] , identifier[deployableUnit] operator[SEP] operator[SEP] identifier[createClassLoader] operator[SEP] operator[SEP] identifier[AbstractSleeComponent] operator[SEP] identifier[sleeComponent] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[SleeComponent] identifier[sleeComponent] operator[:] identifier[duComponentsSet] operator[SEP] {
identifier[loadAndSetNonGeneratedComponentClasses] operator[SEP] operator[SEP] identifier[AbstractSleeComponent] operator[SEP] identifier[sleeComponent] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[SleeComponent] identifier[sleeComponent] operator[:] identifier[duComponentsSet] operator[SEP] {
identifier[ClassLoader] identifier[componentClassLoader] operator[=] identifier[sleeComponent] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[ClassLoader] identifier[oldClassLoader] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[componentClassLoader] operator[!=] Other[null] operator[SEP] {
identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[setContextClassLoader] operator[SEP] identifier[componentClassLoader] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[sleeComponent] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[sleeComponent] operator[SEP] identifier[validate] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DeploymentException] operator[SEP] identifier[sleeComponent] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[sleeComponent] operator[SEP] identifier[processSecurityPermissions] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DeploymentException] operator[SEP] literal[String] operator[+] identifier[sleeComponent] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[componentClassLoader] operator[!=] Other[null] operator[SEP] {
identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[setContextClassLoader] operator[SEP] identifier[oldClassLoader] operator[SEP] operator[SEP]
}
}
}
Keyword[try] {
identifier[deployableUnitJar] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[url] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[deployableUnit] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[deployableUnit] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[deploymentDir] operator[SEP] operator[SEP]
}
identifier[deploymentDir] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[DeploymentException] operator[SEP] {
Keyword[throw] operator[SEP] identifier[DeploymentException] operator[SEP] identifier[e] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[AlreadyDeployedException] operator[SEP] {
Keyword[throw] operator[SEP] identifier[AlreadyDeployedException] operator[SEP] identifier[e] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[DeploymentException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
}
|
public TagsEnvelope getTagSuggestions(String entityType, String tags, String name, Integer count) throws ApiException {
ApiResponse<TagsEnvelope> resp = getTagSuggestionsWithHttpInfo(entityType, tags, name, count);
return resp.getData();
}
|
class class_name[name] begin[{]
method[getTagSuggestions, return_type[type[TagsEnvelope]], modifier[public], parameter[entityType, tags, name, count]] begin[{]
local_variable[type[ApiResponse], resp]
return[call[resp.getData, parameter[]]]
end[}]
END[}]
|
Keyword[public] identifier[TagsEnvelope] identifier[getTagSuggestions] operator[SEP] identifier[String] identifier[entityType] , identifier[String] identifier[tags] , identifier[String] identifier[name] , identifier[Integer] identifier[count] operator[SEP] Keyword[throws] identifier[ApiException] {
identifier[ApiResponse] operator[<] identifier[TagsEnvelope] operator[>] identifier[resp] operator[=] identifier[getTagSuggestionsWithHttpInfo] operator[SEP] identifier[entityType] , identifier[tags] , identifier[name] , identifier[count] operator[SEP] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <T extends Comparable<? super T>> ArrayList<T> sortThis(ArrayList<T> list)
{
return ArrayListIterate.sortThis(list, Comparators.naturalOrder());
}
|
class class_name[name] begin[{]
method[sortThis, return_type[type[ArrayList]], modifier[public static], parameter[list]] begin[{]
return[call[ArrayListIterate.sortThis, parameter[member[.list], call[Comparators.naturalOrder, parameter[]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Comparable] operator[<] operator[?] Keyword[super] identifier[T] operator[>] operator[>] identifier[ArrayList] operator[<] identifier[T] operator[>] identifier[sortThis] operator[SEP] identifier[ArrayList] operator[<] identifier[T] operator[>] identifier[list] operator[SEP] {
Keyword[return] identifier[ArrayListIterate] operator[SEP] identifier[sortThis] operator[SEP] identifier[list] , identifier[Comparators] operator[SEP] identifier[naturalOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void handleDebugEvents(DebugEvent[] events)
{
for (int i = 0; i < events.length; i++)
{
DebugEvent event = events[i];
if (event.getSource().equals(getProcess()))
{
Runnable r = new Runnable()
{
public void run()
{
if (fTerminate != null)
{
fTerminate.update();
}
}
};
DebugUIPlugin.getStandardDisplay().asyncExec(r);
}
}
}
|
class class_name[name] begin[{]
method[handleDebugEvents, return_type[void], modifier[public], parameter[events]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=events, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=event)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DebugEvent, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProcess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fTerminate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=update, postfix_operators=[], prefix_operators=[], qualifier=fTerminate, 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)), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Runnable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getStandardDisplay, postfix_operators=[], prefix_operators=[], qualifier=DebugUIPlugin, selectors=[MethodInvocation(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asyncExec, 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=events, 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[handleDebugEvents] operator[SEP] identifier[DebugEvent] operator[SEP] operator[SEP] identifier[events] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[events] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[DebugEvent] identifier[event] operator[=] identifier[events] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[getProcess] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[Runnable] identifier[r] operator[=] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[fTerminate] operator[!=] Other[null] operator[SEP] {
identifier[fTerminate] operator[SEP] identifier[update] operator[SEP] operator[SEP] operator[SEP]
}
}
} operator[SEP] identifier[DebugUIPlugin] operator[SEP] identifier[getStandardDisplay] operator[SEP] operator[SEP] operator[SEP] identifier[asyncExec] operator[SEP] identifier[r] operator[SEP] operator[SEP]
}
}
}
|
public Stream<T> headStream(T key, boolean inclusive, boolean parallel)
{
return StreamSupport.stream(headSpliterator(key, inclusive), parallel);
}
|
class class_name[name] begin[{]
method[headStream, return_type[type[Stream]], modifier[public], parameter[key, inclusive, parallel]] begin[{]
return[call[StreamSupport.stream, parameter[call[.headSpliterator, parameter[member[.key], member[.inclusive]]], member[.parallel]]]]
end[}]
END[}]
|
Keyword[public] identifier[Stream] operator[<] identifier[T] operator[>] identifier[headStream] operator[SEP] identifier[T] identifier[key] , Keyword[boolean] identifier[inclusive] , Keyword[boolean] identifier[parallel] operator[SEP] {
Keyword[return] identifier[StreamSupport] operator[SEP] identifier[stream] operator[SEP] identifier[headSpliterator] operator[SEP] identifier[key] , identifier[inclusive] operator[SEP] , identifier[parallel] operator[SEP] operator[SEP]
}
|
public void addMessageListener(DigitalChannel channel, Class<? extends Message> messageClass,
MessageListener<Message> messageListener) {
addListener(channel.getIdentifier(), messageClass, messageListener);
}
|
class class_name[name] begin[{]
method[addMessageListener, return_type[void], modifier[public], parameter[channel, messageClass, messageListener]] begin[{]
call[.addListener, parameter[call[channel.getIdentifier, parameter[]], member[.messageClass], member[.messageListener]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[addMessageListener] operator[SEP] identifier[DigitalChannel] identifier[channel] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Message] operator[>] identifier[messageClass] , identifier[MessageListener] operator[<] identifier[Message] operator[>] identifier[messageListener] operator[SEP] {
identifier[addListener] operator[SEP] identifier[channel] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] , identifier[messageClass] , identifier[messageListener] operator[SEP] operator[SEP]
}
|
public final void entryRuleParenthesizedElement() throws RecognitionException {
try {
// InternalXtext.g:1046:1: ( ruleParenthesizedElement EOF )
// InternalXtext.g:1047:1: ruleParenthesizedElement EOF
{
before(grammarAccess.getParenthesizedElementRule());
pushFollow(FollowSets000.FOLLOW_1);
ruleParenthesizedElement();
state._fsp--;
after(grammarAccess.getParenthesizedElementRule());
match(input,EOF,FollowSets000.FOLLOW_2);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return ;
}
|
class class_name[name] begin[{]
method[entryRuleParenthesizedElement, return_type[void], modifier[final public], parameter[]] begin[{]
TryStatement(block=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParenthesizedElementRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=before, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_1, postfix_operators=[], prefix_operators=[], qualifier=FollowSets000, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=ruleParenthesizedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParenthesizedElementRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=after, 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=EOF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=FollowSets000, selectors=[])], member=match, 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=[], label=None, resources=None)
return[None]
end[}]
END[}]
|
Keyword[public] Keyword[final] Keyword[void] identifier[entryRuleParenthesizedElement] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
Keyword[try] {
{
identifier[before] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getParenthesizedElementRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FollowSets000] operator[SEP] identifier[FOLLOW_1] operator[SEP] operator[SEP] identifier[ruleParenthesizedElement] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] identifier[after] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getParenthesizedElementRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[EOF] , identifier[FollowSets000] operator[SEP] identifier[FOLLOW_2] 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] {
}
Keyword[return] operator[SEP]
}
|
public static void registerSerializers(final Kryo kryo) {
final LinkedListMultimapSerializer serializer = new LinkedListMultimapSerializer();
kryo.register(LinkedListMultimap.class, serializer);
}
|
class class_name[name] begin[{]
method[registerSerializers, return_type[void], modifier[public static], parameter[kryo]] begin[{]
local_variable[type[LinkedListMultimapSerializer], serializer]
call[kryo.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LinkedListMultimap, sub_type=None)), member[.serializer]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[registerSerializers] operator[SEP] Keyword[final] identifier[Kryo] identifier[kryo] operator[SEP] {
Keyword[final] identifier[LinkedListMultimapSerializer] identifier[serializer] operator[=] Keyword[new] identifier[LinkedListMultimapSerializer] operator[SEP] operator[SEP] operator[SEP] identifier[kryo] operator[SEP] identifier[register] operator[SEP] identifier[LinkedListMultimap] operator[SEP] Keyword[class] , identifier[serializer] operator[SEP] operator[SEP]
}
|
public void unregisterPainter(Painter painter) {
String className = painter.getPaintableClassName();
if (painters.containsKey(className)) {
List<Painter> list = painters.remove(className);
if (list.size() > 1) {
list.remove(painter);
painters.put(className, list);
}
}
}
|
class class_name[name] begin[{]
method[unregisterPainter, return_type[void], modifier[public], parameter[painter]] begin[{]
local_variable[type[String], className]
if[call[painters.containsKey, parameter[member[.className]]]] begin[{]
local_variable[type[List], list]
if[binary_operation[call[list.size, parameter[]], >, literal[1]]] begin[{]
call[list.remove, parameter[member[.painter]]]
call[painters.put, parameter[member[.className], member[.list]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[unregisterPainter] operator[SEP] identifier[Painter] identifier[painter] operator[SEP] {
identifier[String] identifier[className] operator[=] identifier[painter] operator[SEP] identifier[getPaintableClassName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[painters] operator[SEP] identifier[containsKey] operator[SEP] identifier[className] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[Painter] operator[>] identifier[list] operator[=] identifier[painters] operator[SEP] identifier[remove] operator[SEP] identifier[className] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
identifier[list] operator[SEP] identifier[remove] operator[SEP] identifier[painter] operator[SEP] operator[SEP] identifier[painters] operator[SEP] identifier[put] operator[SEP] identifier[className] , identifier[list] operator[SEP] operator[SEP]
}
}
}
|
public boolean tryEnter(Object obj) {
if (entered.containsKey(obj)) {
return false;
} else {
entered.put(obj, null);
return true;
}
}
|
class class_name[name] begin[{]
method[tryEnter, return_type[type[boolean]], modifier[public], parameter[obj]] begin[{]
if[call[entered.containsKey, parameter[member[.obj]]]] begin[{]
return[literal[false]]
else begin[{]
call[entered.put, parameter[member[.obj], literal[null]]]
return[literal[true]]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[tryEnter] operator[SEP] identifier[Object] identifier[obj] operator[SEP] {
Keyword[if] operator[SEP] identifier[entered] operator[SEP] identifier[containsKey] operator[SEP] identifier[obj] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[entered] operator[SEP] identifier[put] operator[SEP] identifier[obj] , Other[null] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
|
public static void remove(String key) throws IllegalArgumentException {
if (key == null) {
throw new IllegalArgumentException("key parameter cannot be null");
}
if (mdcAdapter == null) {
throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
}
mdcAdapter.remove(key);
}
|
class class_name[name] begin[{]
method[remove, return_type[void], modifier[public static], parameter[key]] begin[{]
if[binary_operation[member[.key], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="key parameter cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.mdcAdapter], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MDCAdapter cannot be null. See also "), operandr=MemberReference(member=NULL_MDCA_URL, 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=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[mdcAdapter.remove, parameter[member[.key]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[remove] operator[SEP] identifier[String] identifier[key] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[mdcAdapter] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[NULL_MDCA_URL] operator[SEP] operator[SEP]
}
identifier[mdcAdapter] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
|
public void createSampleDatas() throws NamingException {
final Context ctx = new InitialContext();
final BeanManager beanManager = (BeanManager) ctx.lookup("java:comp/env/BeanManager");
final EntityManagerFactory entityManagerFactory = BeanManagerUtils.getOrCreateInstance(beanManager, EntityManagerFactory.class);
final EntityManager entityManager = entityManagerFactory.createEntityManager();
entityManager.getTransaction().begin();
entityManager.createQuery("delete from User").executeUpdate();
entityManager.createQuery("delete from Profile").executeUpdate();
final Profile adminProfile = new Profile("Administrator", "admin");
entityManager.persist(adminProfile);
final Profile userProfile = new Profile("User", "user");
entityManager.persist(userProfile);
// final UserService userService = BeanManagerUtils.getOrCreateInstance(beanManager, UserService.class);
entityManager.persist(new User("user", UserService.digestPassword("user", "user"), "User", "user", userProfile));
entityManager.persist(new User("admin", UserService.digestPassword("admin", "admin"), "Admin", "admin", adminProfile));
for (int i = 1; i <= MAX_ORDER; i++) {
final Profile profile = new Profile("User"+i, "user"+i);
entityManager.persist(profile);
for (int j = 1; j <= MAX_ORDER; j++) {
final int id = i*MAX_ORDER + j;
entityManager.persist(new User("user"+id, UserService.digestPassword("user"+id, "user"+id), "User"+id, "user"+id, profile));
}
}
entityManager.getTransaction().commit();
}
|
class class_name[name] begin[{]
method[createSampleDatas, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[Context], ctx]
local_variable[type[BeanManager], beanManager]
local_variable[type[EntityManagerFactory], entityManagerFactory]
local_variable[type[EntityManager], entityManager]
call[entityManager.getTransaction, parameter[]]
call[entityManager.createQuery, parameter[literal["delete from User"]]]
call[entityManager.createQuery, parameter[literal["delete from Profile"]]]
local_variable[type[Profile], adminProfile]
call[entityManager.persist, parameter[member[.adminProfile]]]
local_variable[type[Profile], userProfile]
call[entityManager.persist, parameter[member[.userProfile]]]
call[entityManager.persist, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user"), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user")], member=digestPassword, postfix_operators=[], prefix_operators=[], qualifier=UserService, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="User"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user"), MemberReference(member=userProfile, 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=User, sub_type=None))]]
call[entityManager.persist, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="admin"), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="admin"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="admin")], member=digestPassword, postfix_operators=[], prefix_operators=[], qualifier=UserService, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Admin"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="admin"), MemberReference(member=adminProfile, 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=User, sub_type=None))]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="User"), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user"), operandr=MemberReference(member=i, 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=Profile, sub_type=None)), name=profile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Profile, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=profile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=persist, postfix_operators=[], prefix_operators=[], qualifier=entityManager, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_ORDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=id)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user"), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user"), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user"), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=digestPassword, postfix_operators=[], prefix_operators=[], qualifier=UserService, selectors=[], type_arguments=None), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="User"), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user"), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=profile, 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=User, sub_type=None))], member=persist, postfix_operators=[], prefix_operators=[], qualifier=entityManager, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_ORDER, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_ORDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[entityManager.getTransaction, parameter[]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[createSampleDatas] operator[SEP] operator[SEP] Keyword[throws] identifier[NamingException] {
Keyword[final] identifier[Context] identifier[ctx] operator[=] Keyword[new] identifier[InitialContext] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[BeanManager] identifier[beanManager] operator[=] operator[SEP] identifier[BeanManager] operator[SEP] identifier[ctx] operator[SEP] identifier[lookup] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[EntityManagerFactory] identifier[entityManagerFactory] operator[=] identifier[BeanManagerUtils] operator[SEP] identifier[getOrCreateInstance] operator[SEP] identifier[beanManager] , identifier[EntityManagerFactory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[final] identifier[EntityManager] identifier[entityManager] operator[=] identifier[entityManagerFactory] operator[SEP] identifier[createEntityManager] operator[SEP] operator[SEP] operator[SEP] identifier[entityManager] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[begin] operator[SEP] operator[SEP] operator[SEP] identifier[entityManager] operator[SEP] identifier[createQuery] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP] identifier[entityManager] operator[SEP] identifier[createQuery] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Profile] identifier[adminProfile] operator[=] Keyword[new] identifier[Profile] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[entityManager] operator[SEP] identifier[persist] operator[SEP] identifier[adminProfile] operator[SEP] operator[SEP] Keyword[final] identifier[Profile] identifier[userProfile] operator[=] Keyword[new] identifier[Profile] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[entityManager] operator[SEP] identifier[persist] operator[SEP] identifier[userProfile] operator[SEP] operator[SEP] identifier[entityManager] operator[SEP] identifier[persist] operator[SEP] Keyword[new] identifier[User] operator[SEP] literal[String] , identifier[UserService] operator[SEP] identifier[digestPassword] operator[SEP] literal[String] , literal[String] operator[SEP] , literal[String] , literal[String] , identifier[userProfile] operator[SEP] operator[SEP] operator[SEP] identifier[entityManager] operator[SEP] identifier[persist] operator[SEP] Keyword[new] identifier[User] operator[SEP] literal[String] , identifier[UserService] operator[SEP] identifier[digestPassword] operator[SEP] literal[String] , literal[String] operator[SEP] , literal[String] , literal[String] , identifier[adminProfile] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<=] identifier[MAX_ORDER] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[final] identifier[Profile] identifier[profile] operator[=] Keyword[new] identifier[Profile] operator[SEP] literal[String] operator[+] identifier[i] , literal[String] operator[+] identifier[i] operator[SEP] operator[SEP] identifier[entityManager] operator[SEP] identifier[persist] operator[SEP] identifier[profile] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[1] operator[SEP] identifier[j] operator[<=] identifier[MAX_ORDER] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[final] Keyword[int] identifier[id] operator[=] identifier[i] operator[*] identifier[MAX_ORDER] operator[+] identifier[j] operator[SEP] identifier[entityManager] operator[SEP] identifier[persist] operator[SEP] Keyword[new] identifier[User] operator[SEP] literal[String] operator[+] identifier[id] , identifier[UserService] operator[SEP] identifier[digestPassword] operator[SEP] literal[String] operator[+] identifier[id] , literal[String] operator[+] identifier[id] operator[SEP] , literal[String] operator[+] identifier[id] , literal[String] operator[+] identifier[id] , identifier[profile] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[entityManager] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP]
}
|
public Integer lockActivityInstance(Long actInstId)
throws DataAccessException {
try {
if (!isInTransaction()) throw
new DataAccessException("Cannot lock activity instance without a transaction");
return engineImpl.getDataAccess().lockActivityInstance(actInstId);
} catch (SQLException e) {
throw new DataAccessException(0, "Failed to lock activity instance", e);
}
}
|
class class_name[name] begin[{]
method[lockActivityInstance, return_type[type[Integer]], modifier[public], parameter[actInstId]] begin[{]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isInTransaction, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot lock activity instance without a transaction")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DataAccessException, sub_type=None)), label=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=getDataAccess, postfix_operators=[], prefix_operators=[], qualifier=engineImpl, selectors=[MethodInvocation(arguments=[MemberReference(member=actInstId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lockActivityInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to lock activity instance"), 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=DataAccessException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] identifier[Integer] identifier[lockActivityInstance] operator[SEP] identifier[Long] identifier[actInstId] operator[SEP] Keyword[throws] identifier[DataAccessException] {
Keyword[try] {
Keyword[if] operator[SEP] operator[!] identifier[isInTransaction] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DataAccessException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[engineImpl] operator[SEP] identifier[getDataAccess] operator[SEP] operator[SEP] operator[SEP] identifier[lockActivityInstance] operator[SEP] identifier[actInstId] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DataAccessException] operator[SEP] Other[0] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Nullable
public static IJson readFromStream (@Nonnull final IHasInputStream aISP, @Nonnull final Charset aFallbackCharset)
{
return readFromStream (aISP, aFallbackCharset, null);
}
|
class class_name[name] begin[{]
method[readFromStream, return_type[type[IJson]], modifier[public static], parameter[aISP, aFallbackCharset]] begin[{]
return[call[.readFromStream, parameter[member[.aISP], member[.aFallbackCharset], literal[null]]]]
end[}]
END[}]
|
annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[IJson] identifier[readFromStream] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[IHasInputStream] identifier[aISP] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Charset] identifier[aFallbackCharset] operator[SEP] {
Keyword[return] identifier[readFromStream] operator[SEP] identifier[aISP] , identifier[aFallbackCharset] , Other[null] operator[SEP] operator[SEP]
}
|
public Signature insertArgs(int index, String[] names, Class<?>... types) {
assert names.length == types.length : "names and types must be of the same length";
String[] newArgNames = new String[argNames.length + names.length];
System.arraycopy(names, 0, newArgNames, index, names.length);
if (index != 0) System.arraycopy(argNames, 0, newArgNames, 0, index);
if (argNames.length - index != 0)
System.arraycopy(argNames, index, newArgNames, index + names.length, argNames.length - index);
MethodType newMethodType = methodType.insertParameterTypes(index, types);
return new Signature(newMethodType, newArgNames);
}
|
class class_name[name] begin[{]
method[insertArgs, return_type[type[Signature]], modifier[public], parameter[index, names, types]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[]), operator===), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="names and types must be of the same length"))
local_variable[type[String], newArgNames]
call[System.arraycopy, parameter[member[.names], literal[0], member[.newArgNames], member[.index], member[names.length]]]
if[binary_operation[member[.index], !=, literal[0]]] begin[{]
call[System.arraycopy, parameter[member[.argNames], literal[0], member[.newArgNames], literal[0], member[.index]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[argNames.length], -, member[.index]], !=, literal[0]]] begin[{]
call[System.arraycopy, parameter[member[.argNames], member[.index], member[.newArgNames], binary_operation[member[.index], +, member[names.length]], binary_operation[member[argNames.length], -, member[.index]]]]
else begin[{]
None
end[}]
local_variable[type[MethodType], newMethodType]
return[ClassCreator(arguments=[MemberReference(member=newMethodType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newArgNames, 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=Signature, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[Signature] identifier[insertArgs] operator[SEP] Keyword[int] identifier[index] , identifier[String] operator[SEP] operator[SEP] identifier[names] , identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[types] operator[SEP] {
Keyword[assert] identifier[names] operator[SEP] identifier[length] operator[==] identifier[types] operator[SEP] identifier[length] operator[:] literal[String] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[newArgNames] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[argNames] operator[SEP] identifier[length] operator[+] identifier[names] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[names] , Other[0] , identifier[newArgNames] , identifier[index] , identifier[names] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[!=] Other[0] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[argNames] , Other[0] , identifier[newArgNames] , Other[0] , identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[argNames] operator[SEP] identifier[length] operator[-] identifier[index] operator[!=] Other[0] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[argNames] , identifier[index] , identifier[newArgNames] , identifier[index] operator[+] identifier[names] operator[SEP] identifier[length] , identifier[argNames] operator[SEP] identifier[length] operator[-] identifier[index] operator[SEP] operator[SEP] identifier[MethodType] identifier[newMethodType] operator[=] identifier[methodType] operator[SEP] identifier[insertParameterTypes] operator[SEP] identifier[index] , identifier[types] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Signature] operator[SEP] identifier[newMethodType] , identifier[newArgNames] operator[SEP] operator[SEP]
}
|
public String getYear(int type)
{
if (allow(type&ID3V1))
{
return id3v1.getYear();
}
if (allow(type&ID3V2))
{
return id3v2.getFrameDataString(ID3v2Frames.YEAR);
}
return null;
}
|
class class_name[name] begin[{]
method[getYear, return_type[type[String]], modifier[public], parameter[type]] begin[{]
if[call[.allow, parameter[binary_operation[member[.type], &, member[.ID3V1]]]]] begin[{]
return[call[id3v1.getYear, parameter[]]]
else begin[{]
None
end[}]
if[call[.allow, parameter[binary_operation[member[.type], &, member[.ID3V2]]]]] begin[{]
return[call[id3v2.getFrameDataString, parameter[member[ID3v2Frames.YEAR]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[getYear] operator[SEP] Keyword[int] identifier[type] operator[SEP] {
Keyword[if] operator[SEP] identifier[allow] operator[SEP] identifier[type] operator[&] identifier[ID3V1] operator[SEP] operator[SEP] {
Keyword[return] identifier[id3v1] operator[SEP] identifier[getYear] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[allow] operator[SEP] identifier[type] operator[&] identifier[ID3V2] operator[SEP] operator[SEP] {
Keyword[return] identifier[id3v2] operator[SEP] identifier[getFrameDataString] operator[SEP] identifier[ID3v2Frames] operator[SEP] identifier[YEAR] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public OvhSubscription subscription_subscriptionType_GET(String subscriptionType) throws IOException {
String qPath = "/me/subscription/{subscriptionType}";
StringBuilder sb = path(qPath, subscriptionType);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhSubscription.class);
}
|
class class_name[name] begin[{]
method[subscription_subscriptionType_GET, return_type[type[OvhSubscription]], modifier[public], parameter[subscriptionType]] 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=OvhSubscription, sub_type=None))]]]
end[}]
END[}]
|
Keyword[public] identifier[OvhSubscription] identifier[subscription_subscriptionType_GET] operator[SEP] identifier[String] identifier[subscriptionType] 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[subscriptionType] 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[OvhSubscription] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public static byte[] generateAesKey(final int keysize) {
try {
KeyGenerator keyGenerator = KeyGenerator.getInstance(AES_NAME);
keyGenerator.init(keysize);
SecretKey secretKey = keyGenerator.generateKey();
return secretKey.getEncoded();
} catch (NoSuchAlgorithmException e) {
throw new ImpossibleException(e);
}
}
|
class class_name[name] begin[{]
method[generateAesKey, return_type[type[byte]], modifier[public static], parameter[keysize]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=AES_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=KeyGenerator, selectors=[], type_arguments=None), name=keyGenerator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KeyGenerator, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keysize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=keyGenerator, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=generateKey, postfix_operators=[], prefix_operators=[], qualifier=keyGenerator, selectors=[], type_arguments=None), name=secretKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SecretKey, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=getEncoded, postfix_operators=[], prefix_operators=[], qualifier=secretKey, 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=ImpossibleException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[generateAesKey] operator[SEP] Keyword[final] Keyword[int] identifier[keysize] operator[SEP] {
Keyword[try] {
identifier[KeyGenerator] identifier[keyGenerator] operator[=] identifier[KeyGenerator] operator[SEP] identifier[getInstance] operator[SEP] identifier[AES_NAME] operator[SEP] operator[SEP] identifier[keyGenerator] operator[SEP] identifier[init] operator[SEP] identifier[keysize] operator[SEP] operator[SEP] identifier[SecretKey] identifier[secretKey] operator[=] identifier[keyGenerator] operator[SEP] identifier[generateKey] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[secretKey] operator[SEP] identifier[getEncoded] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ImpossibleException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public EClass getIfcBoxAlignment() {
if (ifcBoxAlignmentEClass == null) {
ifcBoxAlignmentEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(895);
}
return ifcBoxAlignmentEClass;
}
|
class class_name[name] begin[{]
method[getIfcBoxAlignment, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcBoxAlignmentEClass], ==, literal[null]]] begin[{]
assign[member[.ifcBoxAlignmentEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, 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=895)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))]
else begin[{]
None
end[}]
return[member[.ifcBoxAlignmentEClass]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcBoxAlignment] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcBoxAlignmentEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcBoxAlignmentEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[895] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcBoxAlignmentEClass] operator[SEP]
}
|
private void _saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__saveActionPerformed
int[] i = _oList.getSelectedRows();
String[] o = new String[i.length];
for (int j = 0; j < i.length; j++) {
o[j] = (String) _oList.getValueAt(i[j], 0);
}
JFileChooser fc = new JFileChooser();
fc.setFileFilter(new FileNameExtensionFilter("R data file", "Rdata"));
if (R != null) {
fc.setSelectedFile(new File(R.cat("_", o) + ".Rdata"));
if (fc.showSaveDialog(this) == JFileChooser.APPROVE_OPTION && fc.getSelectedFile() != null) {
try {
R.save(fc.getSelectedFile(), o);
} catch (Rsession.RException ex) {
ex.printStackTrace();
}
}
}
}
|
class class_name[name] begin[{]
method[_saveActionPerformed, return_type[void], modifier[private], parameter[evt]] begin[{]
local_variable[type[int], i]
local_variable[type[String], o]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getValueAt, postfix_operators=[], prefix_operators=[], qualifier=_oList, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[JFileChooser], fc]
call[fc.setFileFilter, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="R data file"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Rdata")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileNameExtensionFilter, sub_type=None))]]
if[binary_operation[member[.R], !=, literal[null]]] begin[{]
call[fc.setSelectedFile, parameter[ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_"), MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cat, postfix_operators=[], prefix_operators=[], qualifier=R, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".Rdata"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]]
if[binary_operation[binary_operation[call[fc.showSaveDialog, parameter[THIS[]]], ==, member[JFileChooser.APPROVE_OPTION]], &&, binary_operation[call[fc.getSelectedFile, parameter[]], !=, literal[null]]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSelectedFile, postfix_operators=[], prefix_operators=[], qualifier=fc, selectors=[], type_arguments=None), MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=save, postfix_operators=[], prefix_operators=[], qualifier=R, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Rsession.RException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[_saveActionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] {
Keyword[int] operator[SEP] operator[SEP] identifier[i] operator[=] identifier[_oList] operator[SEP] identifier[getSelectedRows] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[o] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[i] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[i] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[o] operator[SEP] identifier[j] operator[SEP] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[_oList] operator[SEP] identifier[getValueAt] operator[SEP] identifier[i] operator[SEP] identifier[j] operator[SEP] , Other[0] operator[SEP] operator[SEP]
}
identifier[JFileChooser] identifier[fc] operator[=] Keyword[new] identifier[JFileChooser] operator[SEP] operator[SEP] operator[SEP] identifier[fc] operator[SEP] identifier[setFileFilter] operator[SEP] Keyword[new] identifier[FileNameExtensionFilter] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[R] operator[!=] Other[null] operator[SEP] {
identifier[fc] operator[SEP] identifier[setSelectedFile] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[R] operator[SEP] identifier[cat] operator[SEP] literal[String] , identifier[o] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fc] operator[SEP] identifier[showSaveDialog] operator[SEP] Keyword[this] operator[SEP] operator[==] identifier[JFileChooser] operator[SEP] identifier[APPROVE_OPTION] operator[&&] identifier[fc] operator[SEP] identifier[getSelectedFile] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[R] operator[SEP] identifier[save] operator[SEP] identifier[fc] operator[SEP] identifier[getSelectedFile] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Rsession] operator[SEP] identifier[RException] identifier[ex] operator[SEP] {
identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
|
public Object run(String scriptText, String fileName, List list) throws CompilationFailedException {
String[] args = new String[list.size()];
list.toArray(args);
return run(scriptText, fileName, args);
}
|
class class_name[name] begin[{]
method[run, return_type[type[Object]], modifier[public], parameter[scriptText, fileName, list]] begin[{]
local_variable[type[String], args]
call[list.toArray, parameter[member[.args]]]
return[call[.run, parameter[member[.scriptText], member[.fileName], member[.args]]]]
end[}]
END[}]
|
Keyword[public] identifier[Object] identifier[run] operator[SEP] identifier[String] identifier[scriptText] , identifier[String] identifier[fileName] , identifier[List] identifier[list] operator[SEP] Keyword[throws] identifier[CompilationFailedException] {
identifier[String] operator[SEP] operator[SEP] identifier[args] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[toArray] operator[SEP] identifier[args] operator[SEP] operator[SEP] Keyword[return] identifier[run] operator[SEP] identifier[scriptText] , identifier[fileName] , identifier[args] operator[SEP] operator[SEP]
}
|
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> skipLast(int count) {
if (count < 0) {
throw new IndexOutOfBoundsException("count >= 0 required but it was " + count);
}
if (count == 0) {
return RxJavaPlugins.onAssembly(this);
}
return RxJavaPlugins.onAssembly(new FlowableSkipLast<T>(this, count));
}
|
class class_name[name] begin[{]
method[skipLast, return_type[type[Flowable]], modifier[final public], parameter[count]] begin[{]
if[binary_operation[member[.count], <, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="count >= 0 required but it was "), operandr=MemberReference(member=count, 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=IndexOutOfBoundsException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.count], ==, literal[0]]] begin[{]
return[call[RxJavaPlugins.onAssembly, parameter[THIS[]]]]
else begin[{]
None
end[}]
return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=count, 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=T, sub_type=None))], dimensions=None, name=FlowableSkipLast, sub_type=None))]]]
end[}]
END[}]
|
annotation[@] identifier[CheckReturnValue] annotation[@] identifier[BackpressureSupport] operator[SEP] identifier[BackpressureKind] operator[SEP] identifier[FULL] operator[SEP] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[final] identifier[Flowable] operator[<] identifier[T] operator[>] identifier[skipLast] operator[SEP] Keyword[int] identifier[count] operator[SEP] {
Keyword[if] operator[SEP] identifier[count] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] literal[String] operator[+] identifier[count] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[count] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[FlowableSkipLast] operator[<] identifier[T] operator[>] operator[SEP] Keyword[this] , identifier[count] operator[SEP] operator[SEP] operator[SEP]
}
|
public TaxonomyTerm selectTaxonomyTerm(final String taxonomy, final String name) throws SQLException {
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
long taxonomyTermId = 0L;
long termId = 0L;
String description = "";
Timer.Context ctx = metrics.selectTaxonomyTermTimer.time();
try {
conn = connectionSupplier.getConnection();
stmt = conn.prepareStatement(selectTaxonomyTermSQL);
stmt.setString(1, name);
stmt.setString(2, taxonomy);
rs = stmt.executeQuery();
if(rs.next()) {
taxonomyTermId = rs.getLong(1);
termId = rs.getLong(2);
description = rs.getString(3);
} else {
return null;
}
} finally {
ctx.stop();
closeQuietly(conn, stmt, rs);
}
return new TaxonomyTerm(taxonomyTermId, taxonomy, selectTerm(termId), description);
}
|
class class_name[name] begin[{]
method[selectTaxonomyTerm, return_type[type[TaxonomyTerm]], modifier[public], parameter[taxonomy, name]] begin[{]
local_variable[type[Connection], conn]
local_variable[type[PreparedStatement], stmt]
local_variable[type[ResultSet], rs]
local_variable[type[long], taxonomyTermId]
local_variable[type[long], termId]
local_variable[type[String], description]
local_variable[type[Timer], ctx]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=connectionSupplier, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stmt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=selectTaxonomyTermSQL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), MemberReference(member=taxonomy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=taxonomyTermId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=termId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=getString, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=stop, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stmt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
return[ClassCreator(arguments=[MemberReference(member=taxonomyTermId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=taxonomy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=termId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=selectTerm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=description, 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=TaxonomyTerm, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[TaxonomyTerm] identifier[selectTaxonomyTerm] operator[SEP] Keyword[final] identifier[String] identifier[taxonomy] , Keyword[final] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[Connection] identifier[conn] operator[=] Other[null] operator[SEP] identifier[PreparedStatement] identifier[stmt] operator[=] Other[null] operator[SEP] identifier[ResultSet] identifier[rs] operator[=] Other[null] operator[SEP] Keyword[long] identifier[taxonomyTermId] operator[=] Other[0L] operator[SEP] Keyword[long] identifier[termId] operator[=] Other[0L] operator[SEP] identifier[String] identifier[description] operator[=] literal[String] operator[SEP] identifier[Timer] operator[SEP] identifier[Context] identifier[ctx] operator[=] identifier[metrics] operator[SEP] identifier[selectTaxonomyTermTimer] operator[SEP] identifier[time] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[conn] operator[=] identifier[connectionSupplier] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[stmt] operator[=] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[selectTaxonomyTermSQL] operator[SEP] operator[SEP] identifier[stmt] operator[SEP] identifier[setString] operator[SEP] Other[1] , identifier[name] operator[SEP] operator[SEP] identifier[stmt] operator[SEP] identifier[setString] operator[SEP] Other[2] , identifier[taxonomy] operator[SEP] operator[SEP] identifier[rs] operator[=] identifier[stmt] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
identifier[taxonomyTermId] operator[=] identifier[rs] operator[SEP] identifier[getLong] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[termId] operator[=] identifier[rs] operator[SEP] identifier[getLong] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[description] operator[=] identifier[rs] operator[SEP] identifier[getString] operator[SEP] Other[3] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
Keyword[finally] {
identifier[ctx] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[conn] , identifier[stmt] , identifier[rs] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[TaxonomyTerm] operator[SEP] identifier[taxonomyTermId] , identifier[taxonomy] , identifier[selectTerm] operator[SEP] identifier[termId] operator[SEP] , identifier[description] operator[SEP] operator[SEP]
}
|
public void setCookies(final Cookie[] cookies) {
this.cookies.clear();
if (cookies != null) {
for (final Cookie cookie : cookies) {
cookie(cookie);
}
}
}
|
class class_name[name] begin[{]
method[setCookies, return_type[void], modifier[public], parameter[cookies]] begin[{]
THIS[member[None.cookies]call[None.clear, parameter[]]]
if[binary_operation[member[.cookies], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cookie, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cookie, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=cookies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cookie)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Cookie, sub_type=None))), label=None)
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setCookies] operator[SEP] Keyword[final] identifier[Cookie] operator[SEP] operator[SEP] identifier[cookies] operator[SEP] {
Keyword[this] operator[SEP] identifier[cookies] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cookies] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] Keyword[final] identifier[Cookie] identifier[cookie] operator[:] identifier[cookies] operator[SEP] {
identifier[cookie] operator[SEP] identifier[cookie] operator[SEP] operator[SEP]
}
}
}
|
public LocalDate minusYears(int years) {
if (years == 0) {
return this;
}
long instant = getChronology().years().subtract(getLocalMillis(), years);
return withLocalMillis(instant);
}
|
class class_name[name] begin[{]
method[minusYears, return_type[type[LocalDate]], modifier[public], parameter[years]] begin[{]
if[binary_operation[member[.years], ==, literal[0]]] begin[{]
return[THIS[]]
else begin[{]
None
end[}]
local_variable[type[long], instant]
return[call[.withLocalMillis, parameter[member[.instant]]]]
end[}]
END[}]
|
Keyword[public] identifier[LocalDate] identifier[minusYears] operator[SEP] Keyword[int] identifier[years] operator[SEP] {
Keyword[if] operator[SEP] identifier[years] operator[==] Other[0] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP]
}
Keyword[long] identifier[instant] operator[=] identifier[getChronology] operator[SEP] operator[SEP] operator[SEP] identifier[years] operator[SEP] operator[SEP] operator[SEP] identifier[subtract] operator[SEP] identifier[getLocalMillis] operator[SEP] operator[SEP] , identifier[years] operator[SEP] operator[SEP] Keyword[return] identifier[withLocalMillis] operator[SEP] identifier[instant] operator[SEP] operator[SEP]
}
|
@Override
@VisibleForTesting
int getOperationFromRecord(
Record record,
int defaultOpCode,
UnsupportedOperationAction unsupportedAction,
List<OnRecordErrorException> errorRecords ) {
int opCode = -1; // -1 is invalid and not used in OperationType.
String op = null;
try {
// Try sdc.operation.type first
op = record.getHeader().getAttribute(OperationType.SDC_OPERATION_TYPE);
// If not set, look for "__$operation" in record.
if (StringUtils.isBlank(op)) {
if (record.has(MSOperationCode.getOpField())) {
int intOp = record.get(MSOperationCode.getOpField()).getValueAsInteger();
// Convert the MS specific operation code to SDC standard operation code
opCode = MSOperationCode.convertToJDBCCode(intOp);
}
} else {
opCode = JDBCOperationType.convertToIntCode(op);
}
if (opCode == -1) { // Both MS code and sdc code are not set. Use default.
opCode = defaultOpCode;
}
} catch (NumberFormatException | UnsupportedOperationException ex) {
LOG.debug(
"Operation obtained from record is not supported: {}. Handle by UnsupportedOpertaionAction {}. {}",
ex.getMessage(),
unsupportedAction.getLabel(),
ex
);
switch (unsupportedAction) {
case DISCARD:
LOG.debug("Discarding record with unsupported operation {}", op);
break;
case SEND_TO_ERROR:
LOG.debug("Sending record to error due to unsupported operation {}", op);
errorRecords.add(new OnRecordErrorException(record, JdbcErrors.JDBC_70, op));
break;
case USE_DEFAULT:
opCode = defaultOpCode;
break;
default: //unknown action
LOG.debug("Sending record to error due to unknown operation: {}", op);
}
}
return opCode;
}
|
class class_name[name] begin[{]
method[getOperationFromRecord, return_type[type[int]], modifier[default], parameter[record, defaultOpCode, unsupportedAction, errorRecords]] begin[{]
local_variable[type[int], opCode]
local_variable[type[String], op]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getHeader, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[MethodInvocation(arguments=[MemberReference(member=SDC_OPERATION_TYPE, postfix_operators=[], prefix_operators=[], qualifier=OperationType, selectors=[])], member=getAttribute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBlank, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=opCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertToIntCode, postfix_operators=[], prefix_operators=[], qualifier=JDBCOperationType, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOpField, postfix_operators=[], prefix_operators=[], qualifier=MSOperationCode, selectors=[], type_arguments=None)], member=has, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOpField, postfix_operators=[], prefix_operators=[], qualifier=MSOperationCode, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[MethodInvocation(arguments=[], member=getValueAsInteger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=intOp)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=opCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=intOp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertToJDBCCode, postfix_operators=[], prefix_operators=[], qualifier=MSOperationCode, selectors=[], type_arguments=None)), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=opCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=opCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=defaultOpCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Operation obtained from record is not supported: {}. Handle by UnsupportedOpertaionAction {}. {}"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=unsupportedAction, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), SwitchStatement(cases=[SwitchStatementCase(case=['DISCARD'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Discarding record with unsupported operation {}"), MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['SEND_TO_ERROR'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Sending record to error due to unsupported operation {}"), MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=JDBC_70, postfix_operators=[], prefix_operators=[], qualifier=JdbcErrors, selectors=[]), MemberReference(member=op, 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=OnRecordErrorException, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=errorRecords, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['USE_DEFAULT'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=opCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=defaultOpCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Sending record to error due to unknown operation: {}"), MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=unsupportedAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NumberFormatException', 'UnsupportedOperationException']))], finally_block=None, label=None, resources=None)
return[member[.opCode]]
end[}]
END[}]
|
annotation[@] identifier[Override] annotation[@] identifier[VisibleForTesting] Keyword[int] identifier[getOperationFromRecord] operator[SEP] identifier[Record] identifier[record] , Keyword[int] identifier[defaultOpCode] , identifier[UnsupportedOperationAction] identifier[unsupportedAction] , identifier[List] operator[<] identifier[OnRecordErrorException] operator[>] identifier[errorRecords] operator[SEP] {
Keyword[int] identifier[opCode] operator[=] operator[-] Other[1] operator[SEP] identifier[String] identifier[op] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[op] operator[=] identifier[record] operator[SEP] identifier[getHeader] operator[SEP] operator[SEP] operator[SEP] identifier[getAttribute] operator[SEP] identifier[OperationType] operator[SEP] identifier[SDC_OPERATION_TYPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[op] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[record] operator[SEP] identifier[has] operator[SEP] identifier[MSOperationCode] operator[SEP] identifier[getOpField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[intOp] operator[=] identifier[record] operator[SEP] identifier[get] operator[SEP] identifier[MSOperationCode] operator[SEP] identifier[getOpField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getValueAsInteger] operator[SEP] operator[SEP] operator[SEP] identifier[opCode] operator[=] identifier[MSOperationCode] operator[SEP] identifier[convertToJDBCCode] operator[SEP] identifier[intOp] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[opCode] operator[=] identifier[JDBCOperationType] operator[SEP] identifier[convertToIntCode] operator[SEP] identifier[op] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[opCode] operator[==] operator[-] Other[1] operator[SEP] {
identifier[opCode] operator[=] identifier[defaultOpCode] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] operator[|] identifier[UnsupportedOperationException] identifier[ex] operator[SEP] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[unsupportedAction] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[unsupportedAction] operator[SEP] {
Keyword[case] identifier[DISCARD] operator[:] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[op] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[SEND_TO_ERROR] operator[:] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[op] operator[SEP] operator[SEP] identifier[errorRecords] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[OnRecordErrorException] operator[SEP] identifier[record] , identifier[JdbcErrors] operator[SEP] identifier[JDBC_70] , identifier[op] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[USE_DEFAULT] operator[:] identifier[opCode] operator[=] identifier[defaultOpCode] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[op] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[opCode] operator[SEP]
}
|
public UpdateIntegrationResult withRequestParameters(java.util.Map<String, String> requestParameters) {
setRequestParameters(requestParameters);
return this;
}
|
class class_name[name] begin[{]
method[withRequestParameters, return_type[type[UpdateIntegrationResult]], modifier[public], parameter[requestParameters]] begin[{]
call[.setRequestParameters, parameter[member[.requestParameters]]]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[UpdateIntegrationResult] identifier[withRequestParameters] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[requestParameters] operator[SEP] {
identifier[setRequestParameters] operator[SEP] identifier[requestParameters] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@SuppressWarnings("unused")
@RequirePostWithGHHookPayload
public void doIndex(@Nonnull @GHEventHeader GHEvent event, @Nonnull @GHEventPayload String payload) {
GHSubscriberEvent subscriberEvent =
new GHSubscriberEvent(SCMEvent.originOf(Stapler.getCurrentRequest()), event, payload);
from(GHEventsSubscriber.all())
.filter(isInterestedIn(event))
.transform(processEvent(subscriberEvent)).toList();
}
|
class class_name[name] begin[{]
method[doIndex, return_type[void], modifier[public], parameter[event, payload]] begin[{]
local_variable[type[GHSubscriberEvent], subscriberEvent]
call[.from, parameter[call[GHEventsSubscriber.all, parameter[]]]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[RequirePostWithGHHookPayload] Keyword[public] Keyword[void] identifier[doIndex] operator[SEP] annotation[@] identifier[Nonnull] annotation[@] identifier[GHEventHeader] identifier[GHEvent] identifier[event] , annotation[@] identifier[Nonnull] annotation[@] identifier[GHEventPayload] identifier[String] identifier[payload] operator[SEP] {
identifier[GHSubscriberEvent] identifier[subscriberEvent] operator[=] Keyword[new] identifier[GHSubscriberEvent] operator[SEP] identifier[SCMEvent] operator[SEP] identifier[originOf] operator[SEP] identifier[Stapler] operator[SEP] identifier[getCurrentRequest] operator[SEP] operator[SEP] operator[SEP] , identifier[event] , identifier[payload] operator[SEP] operator[SEP] identifier[from] operator[SEP] identifier[GHEventsSubscriber] operator[SEP] identifier[all] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[isInterestedIn] operator[SEP] identifier[event] operator[SEP] operator[SEP] operator[SEP] identifier[transform] operator[SEP] identifier[processEvent] operator[SEP] identifier[subscriberEvent] operator[SEP] operator[SEP] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP]
}
|
public void insertKVRecord(Object keyBase, long keyOffset, int keyLen,
Object valueBase, long valueOffset, int valueLen, long prefix, boolean prefixIsNull)
throws IOException {
growPointerArrayIfNecessary();
int uaoSize = UnsafeAlignedOffset.getUaoSize();
final int required = keyLen + valueLen + (2 * uaoSize);
acquireNewPageIfNecessary(required);
final Object base = currentPage.getBaseObject();
final long recordAddress = taskMemoryManager.encodePageNumberAndOffset(currentPage, pageCursor);
UnsafeAlignedOffset.putSize(base, pageCursor, keyLen + valueLen + uaoSize);
pageCursor += uaoSize;
UnsafeAlignedOffset.putSize(base, pageCursor, keyLen);
pageCursor += uaoSize;
Platform.copyMemory(keyBase, keyOffset, base, pageCursor, keyLen);
pageCursor += keyLen;
Platform.copyMemory(valueBase, valueOffset, base, pageCursor, valueLen);
pageCursor += valueLen;
assert(inMemSorter != null);
inMemSorter.insertRecord(recordAddress, prefix, prefixIsNull);
}
|
class class_name[name] begin[{]
method[insertKVRecord, return_type[void], modifier[public], parameter[keyBase, keyOffset, keyLen, valueBase, valueOffset, valueLen, prefix, prefixIsNull]] begin[{]
call[.growPointerArrayIfNecessary, parameter[]]
local_variable[type[int], uaoSize]
local_variable[type[int], required]
call[.acquireNewPageIfNecessary, parameter[member[.required]]]
local_variable[type[Object], base]
local_variable[type[long], recordAddress]
call[UnsafeAlignedOffset.putSize, parameter[member[.base], member[.pageCursor], binary_operation[binary_operation[member[.keyLen], +, member[.valueLen]], +, member[.uaoSize]]]]
assign[member[.pageCursor], member[.uaoSize]]
call[UnsafeAlignedOffset.putSize, parameter[member[.base], member[.pageCursor], member[.keyLen]]]
assign[member[.pageCursor], member[.uaoSize]]
call[Platform.copyMemory, parameter[member[.keyBase], member[.keyOffset], member[.base], member[.pageCursor], member[.keyLen]]]
assign[member[.pageCursor], member[.keyLen]]
call[Platform.copyMemory, parameter[member[.valueBase], member[.valueOffset], member[.base], member[.pageCursor], member[.valueLen]]]
assign[member[.pageCursor], member[.valueLen]]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=inMemSorter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
call[inMemSorter.insertRecord, parameter[member[.recordAddress], member[.prefix], member[.prefixIsNull]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[insertKVRecord] operator[SEP] identifier[Object] identifier[keyBase] , Keyword[long] identifier[keyOffset] , Keyword[int] identifier[keyLen] , identifier[Object] identifier[valueBase] , Keyword[long] identifier[valueOffset] , Keyword[int] identifier[valueLen] , Keyword[long] identifier[prefix] , Keyword[boolean] identifier[prefixIsNull] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[growPointerArrayIfNecessary] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[uaoSize] operator[=] identifier[UnsafeAlignedOffset] operator[SEP] identifier[getUaoSize] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[required] operator[=] identifier[keyLen] operator[+] identifier[valueLen] operator[+] operator[SEP] Other[2] operator[*] identifier[uaoSize] operator[SEP] operator[SEP] identifier[acquireNewPageIfNecessary] operator[SEP] identifier[required] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[base] operator[=] identifier[currentPage] operator[SEP] identifier[getBaseObject] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[recordAddress] operator[=] identifier[taskMemoryManager] operator[SEP] identifier[encodePageNumberAndOffset] operator[SEP] identifier[currentPage] , identifier[pageCursor] operator[SEP] operator[SEP] identifier[UnsafeAlignedOffset] operator[SEP] identifier[putSize] operator[SEP] identifier[base] , identifier[pageCursor] , identifier[keyLen] operator[+] identifier[valueLen] operator[+] identifier[uaoSize] operator[SEP] operator[SEP] identifier[pageCursor] operator[+=] identifier[uaoSize] operator[SEP] identifier[UnsafeAlignedOffset] operator[SEP] identifier[putSize] operator[SEP] identifier[base] , identifier[pageCursor] , identifier[keyLen] operator[SEP] operator[SEP] identifier[pageCursor] operator[+=] identifier[uaoSize] operator[SEP] identifier[Platform] operator[SEP] identifier[copyMemory] operator[SEP] identifier[keyBase] , identifier[keyOffset] , identifier[base] , identifier[pageCursor] , identifier[keyLen] operator[SEP] operator[SEP] identifier[pageCursor] operator[+=] identifier[keyLen] operator[SEP] identifier[Platform] operator[SEP] identifier[copyMemory] operator[SEP] identifier[valueBase] , identifier[valueOffset] , identifier[base] , identifier[pageCursor] , identifier[valueLen] operator[SEP] operator[SEP] identifier[pageCursor] operator[+=] identifier[valueLen] operator[SEP] Keyword[assert] operator[SEP] identifier[inMemSorter] operator[!=] Other[null] operator[SEP] operator[SEP] identifier[inMemSorter] operator[SEP] identifier[insertRecord] operator[SEP] identifier[recordAddress] , identifier[prefix] , identifier[prefixIsNull] operator[SEP] operator[SEP]
}
|
protected void doSave() {
List<CmsFavoriteEntry> entries = getEntries();
try {
m_favDao.saveFavorites(entries);
} catch (Exception e) {
CmsErrorDialog.showErrorDialog(e);
}
}
|
class class_name[name] begin[{]
method[doSave, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[List], entries]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=saveFavorites, postfix_operators=[], prefix_operators=[], qualifier=m_favDao, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=showErrorDialog, postfix_operators=[], prefix_operators=[], qualifier=CmsErrorDialog, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[doSave] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[CmsFavoriteEntry] operator[>] identifier[entries] operator[=] identifier[getEntries] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[m_favDao] operator[SEP] identifier[saveFavorites] operator[SEP] identifier[entries] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[CmsErrorDialog] operator[SEP] identifier[showErrorDialog] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
public static <E> E createRecord(Class<E> type, Schema schema) {
// Don't instantiate SpecificRecords or interfaces.
if (isGeneric(type) && !type.isInterface()) {
if (GenericData.Record.class.equals(type)) {
return (E) GenericData.get().newRecord(null, schema);
}
return (E) ReflectData.newInstance(type, schema);
}
return null;
}
|
class class_name[name] begin[{]
method[createRecord, return_type[type[E]], modifier[public static], parameter[type, schema]] begin[{]
if[binary_operation[call[.isGeneric, parameter[member[.type]]], &&, call[type.isInterface, parameter[]]]] begin[{]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=GenericData, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Record, sub_type=None))] begin[{]
return[Cast(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=GenericData, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))]
else begin[{]
None
end[}]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=ReflectData, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[E] identifier[createRecord] operator[SEP] identifier[Class] operator[<] identifier[E] operator[>] identifier[type] , identifier[Schema] identifier[schema] operator[SEP] {
Keyword[if] operator[SEP] identifier[isGeneric] operator[SEP] identifier[type] operator[SEP] operator[&&] operator[!] identifier[type] operator[SEP] identifier[isInterface] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[GenericData] operator[SEP] identifier[Record] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[E] operator[SEP] identifier[GenericData] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[newRecord] operator[SEP] Other[null] , identifier[schema] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[E] operator[SEP] identifier[ReflectData] operator[SEP] identifier[newInstance] operator[SEP] identifier[type] , identifier[schema] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public boolean determine(HttpServletRequest request) {
final String methodName = mappingMethodName;
return !isParameterEmpty(request.getParameter(methodName)) // e.g. doUpdate=update
|| !isParameterEmpty(request.getParameter(methodName + ".x")) // e.g. doUpdate.x=update
|| !isParameterEmpty(request.getParameter(methodName + ".y")); // e.g. doUpdate.y=update
}
|
class class_name[name] begin[{]
method[determine, return_type[type[boolean]], modifier[public], parameter[request]] begin[{]
local_variable[type[String], methodName]
return[binary_operation[binary_operation[call[.isParameterEmpty, parameter[call[request.getParameter, parameter[member[.methodName]]]]], ||, call[.isParameterEmpty, parameter[call[request.getParameter, parameter[binary_operation[member[.methodName], +, literal[".x"]]]]]]], ||, call[.isParameterEmpty, parameter[call[request.getParameter, parameter[binary_operation[member[.methodName], +, literal[".y"]]]]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[determine] operator[SEP] identifier[HttpServletRequest] identifier[request] operator[SEP] {
Keyword[final] identifier[String] identifier[methodName] operator[=] identifier[mappingMethodName] operator[SEP] Keyword[return] operator[!] identifier[isParameterEmpty] operator[SEP] identifier[request] operator[SEP] identifier[getParameter] operator[SEP] identifier[methodName] operator[SEP] operator[SEP] operator[||] operator[!] identifier[isParameterEmpty] operator[SEP] identifier[request] operator[SEP] identifier[getParameter] operator[SEP] identifier[methodName] operator[+] literal[String] operator[SEP] operator[SEP] operator[||] operator[!] identifier[isParameterEmpty] operator[SEP] identifier[request] operator[SEP] identifier[getParameter] operator[SEP] identifier[methodName] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.