code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
|---|---|---|
public Map<String, String> toMap() {
Map<String, String> map = new HashMap<>();
map.put("message", this.getMessage());
map.put("success", this.getSuccess());
map.put("is_ported", this.getIsPorted());
map.put("is_cellphone", this.getIsCellphone());
return map;
}
|
class class_name[name] begin[{]
method[toMap, return_type[type[Map]], modifier[public], parameter[]] begin[{]
local_variable[type[Map], map]
call[map.put, parameter[literal["message"], THIS[call[None.getMessage, parameter[]]]]]
call[map.put, parameter[literal["success"], THIS[call[None.getSuccess, parameter[]]]]]
call[map.put, parameter[literal["is_ported"], THIS[call[None.getIsPorted, parameter[]]]]]
call[map.put, parameter[literal["is_cellphone"], THIS[call[None.getIsCellphone, parameter[]]]]]
return[member[.map]]
end[}]
END[}]
|
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[toMap] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getSuccess] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getIsPorted] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getIsCellphone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[map] operator[SEP]
}
|
@Override
public void postSetup(Site site) {
if(processors != null){
for(Processor p: processors){
p.postSetup(site);
}
}
}
|
class class_name[name] begin[{]
method[postSetup, return_type[void], modifier[public], parameter[site]] begin[{]
if[binary_operation[member[.processors], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=site, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=postSetup, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=processors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Processor, sub_type=None))), label=None)
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[postSetup] operator[SEP] identifier[Site] identifier[site] operator[SEP] {
Keyword[if] operator[SEP] identifier[processors] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Processor] identifier[p] operator[:] identifier[processors] operator[SEP] {
identifier[p] operator[SEP] identifier[postSetup] operator[SEP] identifier[site] operator[SEP] operator[SEP]
}
}
}
|
public DirContext createDirContext() throws NamingException {
LOGGER.debug("Creating directory service context (DirContext)");
final Hashtable<String, String> env = new Hashtable<>();
env.put(Context.SECURITY_PRINCIPAL, BIND_USERNAME);
env.put(Context.SECURITY_CREDENTIALS, BIND_PASSWORD);
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, LDAP_URL);
if (IS_LDAP_SSLTLS) {
env.put("java.naming.ldap.factory.socket", "alpine.crypto.RelaxedSSLSocketFactory");
}
return new InitialDirContext(env);
}
|
class class_name[name] begin[{]
method[createDirContext, return_type[type[DirContext]], modifier[public], parameter[]] begin[{]
call[LOGGER.debug, parameter[literal["Creating directory service context (DirContext)"]]]
local_variable[type[Hashtable], env]
call[env.put, parameter[member[Context.SECURITY_PRINCIPAL], member[.BIND_USERNAME]]]
call[env.put, parameter[member[Context.SECURITY_CREDENTIALS], member[.BIND_PASSWORD]]]
call[env.put, parameter[member[Context.INITIAL_CONTEXT_FACTORY], literal["com.sun.jndi.ldap.LdapCtxFactory"]]]
call[env.put, parameter[member[Context.PROVIDER_URL], member[.LDAP_URL]]]
if[member[.IS_LDAP_SSLTLS]] begin[{]
call[env.put, parameter[literal["java.naming.ldap.factory.socket"], literal["alpine.crypto.RelaxedSSLSocketFactory"]]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=env, 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=InitialDirContext, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[DirContext] identifier[createDirContext] operator[SEP] operator[SEP] Keyword[throws] identifier[NamingException] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Hashtable] operator[<] identifier[String] , identifier[String] operator[>] identifier[env] operator[=] Keyword[new] identifier[Hashtable] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[put] operator[SEP] identifier[Context] operator[SEP] identifier[SECURITY_PRINCIPAL] , identifier[BIND_USERNAME] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[put] operator[SEP] identifier[Context] operator[SEP] identifier[SECURITY_CREDENTIALS] , identifier[BIND_PASSWORD] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[put] operator[SEP] identifier[Context] operator[SEP] identifier[INITIAL_CONTEXT_FACTORY] , literal[String] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[put] operator[SEP] identifier[Context] operator[SEP] identifier[PROVIDER_URL] , identifier[LDAP_URL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[IS_LDAP_SSLTLS] operator[SEP] {
identifier[env] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[InitialDirContext] operator[SEP] identifier[env] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
public static <V> CacheValue<V> getInstance(V value) {
if (value == null) {
return NULL_VALUE;
}
return strength == Strength.STRONG ? new StrongValue<V>(value) : new SoftValue<V>(value);
}
|
class class_name[name] begin[{]
method[getInstance, return_type[type[CacheValue]], modifier[public static], parameter[value]] begin[{]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
return[member[.NULL_VALUE]]
else begin[{]
None
end[}]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=strength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=STRONG, postfix_operators=[], prefix_operators=[], qualifier=Strength, selectors=[]), operator===), if_false=ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=SoftValue, sub_type=None)), if_true=ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=StrongValue, sub_type=None)))]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[V] operator[>] identifier[CacheValue] operator[<] identifier[V] operator[>] identifier[getInstance] operator[SEP] identifier[V] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[NULL_VALUE] operator[SEP]
}
Keyword[return] identifier[strength] operator[==] identifier[Strength] operator[SEP] identifier[STRONG] operator[?] Keyword[new] identifier[StrongValue] operator[<] identifier[V] operator[>] operator[SEP] identifier[value] operator[SEP] operator[:] Keyword[new] identifier[SoftValue] operator[<] identifier[V] operator[>] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
|
public T elementPower( double b )
{
T c = createLike();
ops.elementPower(mat,b,c.mat);
return c;
}
|
class class_name[name] begin[{]
method[elementPower, return_type[type[T]], modifier[public], parameter[b]] begin[{]
local_variable[type[T], c]
call[ops.elementPower, parameter[member[.mat], member[.b], member[c.mat]]]
return[member[.c]]
end[}]
END[}]
|
Keyword[public] identifier[T] identifier[elementPower] operator[SEP] Keyword[double] identifier[b] operator[SEP] {
identifier[T] identifier[c] operator[=] identifier[createLike] operator[SEP] operator[SEP] operator[SEP] identifier[ops] operator[SEP] identifier[elementPower] operator[SEP] identifier[mat] , identifier[b] , identifier[c] operator[SEP] identifier[mat] operator[SEP] operator[SEP] Keyword[return] identifier[c] operator[SEP]
}
|
private StringBuilder makeNewPackageName(final StringBuilder packageName, final File dir) {
if (packageName.length() == 0) {
return new StringBuilder(dir.getName());
} else {
return new StringBuilder(packageName).append(PATH_SEPARATOR).append(dir.getName());
}
}
|
class class_name[name] begin[{]
method[makeNewPackageName, return_type[type[StringBuilder]], modifier[private], parameter[packageName, dir]] begin[{]
if[binary_operation[call[packageName.length, parameter[]], ==, literal[0]]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=dir, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))]
else begin[{]
return[ClassCreator(arguments=[MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=PATH_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=dir, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))]
end[}]
end[}]
END[}]
|
Keyword[private] identifier[StringBuilder] identifier[makeNewPackageName] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[packageName] , Keyword[final] identifier[File] identifier[dir] operator[SEP] {
Keyword[if] operator[SEP] identifier[packageName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[dir] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[PATH_SEPARATOR] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[dir] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static UIContext getClosestContextForId(final WComponent root, final String id,
final boolean visibleOnly) {
FindComponentByIdVisitor visitor = new FindComponentByIdVisitor(id) {
@Override
public VisitorResult visit(final WComponent comp) {
VisitorResult result = super.visit(comp);
if (result == VisitorResult.CONTINUE) {
// Save closest UIC as processing tree
setResult(new ComponentWithContext(comp, UIContextHolder.getCurrent()));
}
return result;
}
};
doTraverse(root, visibleOnly, visitor);
return visitor.getResult() == null ? null : visitor.getResult().getContext();
}
|
class class_name[name] begin[{]
method[getClosestContextForId, return_type[type[UIContext]], modifier[public static], parameter[root, id, visibleOnly]] begin[{]
local_variable[type[FindComponentByIdVisitor], visitor]
call[.doTraverse, parameter[member[.root], member[.visibleOnly], member[.visitor]]]
return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getResult, postfix_operators=[], prefix_operators=[], qualifier=visitor, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getResult, postfix_operators=[], prefix_operators=[], qualifier=visitor, selectors=[MethodInvocation(arguments=[], member=getContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[UIContext] identifier[getClosestContextForId] operator[SEP] Keyword[final] identifier[WComponent] identifier[root] , Keyword[final] identifier[String] identifier[id] , Keyword[final] Keyword[boolean] identifier[visibleOnly] operator[SEP] {
identifier[FindComponentByIdVisitor] identifier[visitor] operator[=] Keyword[new] identifier[FindComponentByIdVisitor] operator[SEP] identifier[id] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[VisitorResult] identifier[visit] operator[SEP] Keyword[final] identifier[WComponent] identifier[comp] operator[SEP] {
identifier[VisitorResult] identifier[result] operator[=] Keyword[super] operator[SEP] identifier[visit] operator[SEP] identifier[comp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] identifier[VisitorResult] operator[SEP] identifier[CONTINUE] operator[SEP] {
identifier[setResult] operator[SEP] Keyword[new] identifier[ComponentWithContext] operator[SEP] identifier[comp] , identifier[UIContextHolder] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
} operator[SEP] identifier[doTraverse] operator[SEP] identifier[root] , identifier[visibleOnly] , identifier[visitor] operator[SEP] operator[SEP] Keyword[return] identifier[visitor] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[visitor] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void sliceByRowsAndCols(Image srcImage, File destDir, int rows, int cols) {
if (false == destDir.exists()) {
FileUtil.mkdir(destDir);
} else if (false == destDir.isDirectory()) {
throw new IllegalArgumentException("Destination Dir must be a Directory !");
}
try {
if (rows <= 0 || rows > 20) {
rows = 2; // 切片行数
}
if (cols <= 0 || cols > 20) {
cols = 2; // 切片列数
}
// 读取源图像
final BufferedImage bi = toBufferedImage(srcImage);
int srcWidth = bi.getWidth(); // 源图宽度
int srcHeight = bi.getHeight(); // 源图高度
int destWidth = NumberUtil.partValue(srcWidth, cols); // 每张切片的宽度
int destHeight = NumberUtil.partValue(srcHeight, rows); // 每张切片的高度
// 循环建立切片
BufferedImage tag;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
tag = cut(bi, new Rectangle(j * destWidth, i * destHeight, destWidth, destHeight));
// 输出为文件
ImageIO.write(tag, IMAGE_TYPE_JPEG, new File(destDir, "_r" + i + "_c" + j + ".jpg"));
}
}
} catch (IOException e) {
throw new IORuntimeException(e);
}
}
|
class class_name[name] begin[{]
method[sliceByRowsAndCols, return_type[void], modifier[public static], parameter[srcImage, destDir, rows, cols]] begin[{]
if[binary_operation[literal[false], ==, call[destDir.exists, parameter[]]]] begin[{]
call[FileUtil.mkdir, parameter[member[.destDir]]]
else begin[{]
if[binary_operation[literal[false], ==, call[destDir.isDirectory, parameter[]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination Dir must be a Directory !")], 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[}]
end[}]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), operandr=BinaryOperation(operandl=MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=20), operator=>), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), operandr=BinaryOperation(operandl=MemberReference(member=cols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=20), operator=>), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=srcImage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toBufferedImage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=bi)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None), name=srcWidth)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None), name=srcHeight)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=srcWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=partValue, postfix_operators=[], prefix_operators=[], qualifier=NumberUtil, selectors=[], type_arguments=None), name=destWidth)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=srcHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=partValue, postfix_operators=[], prefix_operators=[], qualifier=NumberUtil, selectors=[], type_arguments=None), name=destHeight)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=tag)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=bi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=destWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=destHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), MemberReference(member=destWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=destHeight, 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=Rectangle, sub_type=None))], member=cut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=IMAGE_TYPE_JPEG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=destDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_r"), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_c"), operator=+), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".jpg"), 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))], member=write, postfix_operators=[], prefix_operators=[], qualifier=ImageIO, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=cols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)], 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=IORuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[sliceByRowsAndCols] operator[SEP] identifier[Image] identifier[srcImage] , identifier[File] identifier[destDir] , Keyword[int] identifier[rows] , Keyword[int] identifier[cols] operator[SEP] {
Keyword[if] operator[SEP] literal[boolean] operator[==] identifier[destDir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[FileUtil] operator[SEP] identifier[mkdir] operator[SEP] identifier[destDir] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[boolean] operator[==] identifier[destDir] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[if] operator[SEP] identifier[rows] operator[<=] Other[0] operator[||] identifier[rows] operator[>] Other[20] operator[SEP] {
identifier[rows] operator[=] Other[2] operator[SEP]
}
Keyword[if] operator[SEP] identifier[cols] operator[<=] Other[0] operator[||] identifier[cols] operator[>] Other[20] operator[SEP] {
identifier[cols] operator[=] Other[2] operator[SEP]
}
Keyword[final] identifier[BufferedImage] identifier[bi] operator[=] identifier[toBufferedImage] operator[SEP] identifier[srcImage] operator[SEP] operator[SEP] Keyword[int] identifier[srcWidth] operator[=] identifier[bi] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[srcHeight] operator[=] identifier[bi] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[destWidth] operator[=] identifier[NumberUtil] operator[SEP] identifier[partValue] operator[SEP] identifier[srcWidth] , identifier[cols] operator[SEP] operator[SEP] Keyword[int] identifier[destHeight] operator[=] identifier[NumberUtil] operator[SEP] identifier[partValue] operator[SEP] identifier[srcHeight] , identifier[rows] operator[SEP] operator[SEP] identifier[BufferedImage] identifier[tag] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[rows] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[cols] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[tag] operator[=] identifier[cut] operator[SEP] identifier[bi] , Keyword[new] identifier[Rectangle] operator[SEP] identifier[j] operator[*] identifier[destWidth] , identifier[i] operator[*] identifier[destHeight] , identifier[destWidth] , identifier[destHeight] operator[SEP] operator[SEP] operator[SEP] identifier[ImageIO] operator[SEP] identifier[write] operator[SEP] identifier[tag] , identifier[IMAGE_TYPE_JPEG] , Keyword[new] identifier[File] operator[SEP] identifier[destDir] , literal[String] operator[+] identifier[i] operator[+] literal[String] operator[+] identifier[j] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IORuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
private static Map<String, CmsHtmlList> getListObjectMap(CmsWorkplaceSettings settings) {
Map<String, CmsHtmlList> objects = CmsCollectionsGenericWrapper.map(settings.getListObject());
if (objects == null) {
// using hashtable as most efficient version of a synchronized map
objects = new Hashtable<String, CmsHtmlList>();
settings.setListObject(objects);
}
return objects;
}
|
class class_name[name] begin[{]
method[getListObjectMap, return_type[type[Map]], modifier[private static], parameter[settings]] begin[{]
local_variable[type[Map], objects]
if[binary_operation[member[.objects], ==, literal[null]]] begin[{]
assign[member[.objects], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsHtmlList, sub_type=None))], dimensions=None, name=Hashtable, sub_type=None))]
call[settings.setListObject, parameter[member[.objects]]]
else begin[{]
None
end[}]
return[member[.objects]]
end[}]
END[}]
|
Keyword[private] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[CmsHtmlList] operator[>] identifier[getListObjectMap] operator[SEP] identifier[CmsWorkplaceSettings] identifier[settings] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[CmsHtmlList] operator[>] identifier[objects] operator[=] identifier[CmsCollectionsGenericWrapper] operator[SEP] identifier[map] operator[SEP] identifier[settings] operator[SEP] identifier[getListObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[objects] operator[==] Other[null] operator[SEP] {
identifier[objects] operator[=] Keyword[new] identifier[Hashtable] operator[<] identifier[String] , identifier[CmsHtmlList] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setListObject] operator[SEP] identifier[objects] operator[SEP] operator[SEP]
}
Keyword[return] identifier[objects] operator[SEP]
}
|
public void getTimeOid (String arg1, TimeBaseService.GotTimeBaseListener arg2)
{
TimeBaseMarshaller.GotTimeBaseMarshaller listener2 = new TimeBaseMarshaller.GotTimeBaseMarshaller();
listener2.listener = arg2;
sendRequest(GET_TIME_OID, new Object[] {
arg1, listener2
});
}
|
class class_name[name] begin[{]
method[getTimeOid, return_type[void], modifier[public], parameter[arg1, arg2]] begin[{]
local_variable[type[TimeBaseMarshaller], listener2]
assign[member[listener2.listener], member[.arg2]]
call[.sendRequest, parameter[member[.GET_TIME_OID], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=arg1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=listener2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[getTimeOid] operator[SEP] identifier[String] identifier[arg1] , identifier[TimeBaseService] operator[SEP] identifier[GotTimeBaseListener] identifier[arg2] operator[SEP] {
identifier[TimeBaseMarshaller] operator[SEP] identifier[GotTimeBaseMarshaller] identifier[listener2] operator[=] Keyword[new] identifier[TimeBaseMarshaller] operator[SEP] identifier[GotTimeBaseMarshaller] operator[SEP] operator[SEP] operator[SEP] identifier[listener2] operator[SEP] identifier[listener] operator[=] identifier[arg2] operator[SEP] identifier[sendRequest] operator[SEP] identifier[GET_TIME_OID] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[arg1] , identifier[listener2]
} operator[SEP] operator[SEP]
}
|
public boolean deleteEdgeReference(AtlasEdge edge, DataTypes.TypeCategory typeCategory, boolean isComposite,
boolean forceDeleteStructTrait) throws AtlasException {
if (LOG.isDebugEnabled()) {
LOG.debug("Deleting {}", string(edge));
}
boolean forceDelete =
(typeCategory == DataTypes.TypeCategory.STRUCT || typeCategory == DataTypes.TypeCategory.TRAIT) && forceDeleteStructTrait;
if (typeCategory == DataTypes.TypeCategory.STRUCT || typeCategory == DataTypes.TypeCategory.TRAIT
|| (typeCategory == DataTypes.TypeCategory.CLASS && isComposite)) {
//If the vertex is of type struct/trait, delete the edge and then the reference vertex as the vertex is not shared by any other entities.
//If the vertex is of type class, and its composite attribute, this reference vertex' lifecycle is controlled
//through this delete, hence delete the edge and the reference vertex.
AtlasVertex vertexForDelete = edge.getInVertex();
//If deleting the edge and then the in vertex, reverse attribute shouldn't be updated
deleteEdge(edge, false, forceDelete);
deleteTypeVertex(vertexForDelete, typeCategory, forceDelete);
} else {
//If the vertex is of type class, and its not a composite attributes, the reference AtlasVertex' lifecycle is not controlled
//through this delete. Hence just remove the reference edge. Leave the reference AtlasVertex as is
//If deleting just the edge, reverse attribute should be updated for any references
//For example, for the department type system, if the person's manager edge is deleted, subordinates of manager should be updated
deleteEdge(edge, true, false);
}
return !softDelete || forceDelete;
}
|
class class_name[name] begin[{]
method[deleteEdgeReference, return_type[type[boolean]], modifier[public], parameter[edge, typeCategory, isComposite, forceDeleteStructTrait]] begin[{]
if[call[LOG.isDebugEnabled, parameter[]]] begin[{]
call[LOG.debug, parameter[literal["Deleting {}"], call[.string, parameter[member[.edge]]]]]
else begin[{]
None
end[}]
local_variable[type[boolean], forceDelete]
if[binary_operation[binary_operation[binary_operation[member[.typeCategory], ==, member[DataTypes.TypeCategory.STRUCT]], ||, binary_operation[member[.typeCategory], ==, member[DataTypes.TypeCategory.TRAIT]]], ||, binary_operation[binary_operation[member[.typeCategory], ==, member[DataTypes.TypeCategory.CLASS]], &&, member[.isComposite]]]] begin[{]
local_variable[type[AtlasVertex], vertexForDelete]
call[.deleteEdge, parameter[member[.edge], literal[false], member[.forceDelete]]]
call[.deleteTypeVertex, parameter[member[.vertexForDelete], member[.typeCategory], member[.forceDelete]]]
else begin[{]
call[.deleteEdge, parameter[member[.edge], literal[true], literal[false]]]
end[}]
return[binary_operation[member[.softDelete], ||, member[.forceDelete]]]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[deleteEdgeReference] operator[SEP] identifier[AtlasEdge] identifier[edge] , identifier[DataTypes] operator[SEP] identifier[TypeCategory] identifier[typeCategory] , Keyword[boolean] identifier[isComposite] , Keyword[boolean] identifier[forceDeleteStructTrait] operator[SEP] Keyword[throws] identifier[AtlasException] {
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[string] operator[SEP] identifier[edge] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[forceDelete] operator[=] operator[SEP] identifier[typeCategory] operator[==] identifier[DataTypes] operator[SEP] identifier[TypeCategory] operator[SEP] identifier[STRUCT] operator[||] identifier[typeCategory] operator[==] identifier[DataTypes] operator[SEP] identifier[TypeCategory] operator[SEP] identifier[TRAIT] operator[SEP] operator[&&] identifier[forceDeleteStructTrait] operator[SEP] Keyword[if] operator[SEP] identifier[typeCategory] operator[==] identifier[DataTypes] operator[SEP] identifier[TypeCategory] operator[SEP] identifier[STRUCT] operator[||] identifier[typeCategory] operator[==] identifier[DataTypes] operator[SEP] identifier[TypeCategory] operator[SEP] identifier[TRAIT] operator[||] operator[SEP] identifier[typeCategory] operator[==] identifier[DataTypes] operator[SEP] identifier[TypeCategory] operator[SEP] identifier[CLASS] operator[&&] identifier[isComposite] operator[SEP] operator[SEP] {
identifier[AtlasVertex] identifier[vertexForDelete] operator[=] identifier[edge] operator[SEP] identifier[getInVertex] operator[SEP] operator[SEP] operator[SEP] identifier[deleteEdge] operator[SEP] identifier[edge] , literal[boolean] , identifier[forceDelete] operator[SEP] operator[SEP] identifier[deleteTypeVertex] operator[SEP] identifier[vertexForDelete] , identifier[typeCategory] , identifier[forceDelete] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[deleteEdge] operator[SEP] identifier[edge] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[return] operator[!] identifier[softDelete] operator[||] identifier[forceDelete] operator[SEP]
}
|
public static CommerceAccountOrganizationRel[] findByOrganizationId_PrevAndNext(
CommerceAccountOrganizationRelPK commerceAccountOrganizationRelPK,
long organizationId,
OrderByComparator<CommerceAccountOrganizationRel> orderByComparator)
throws com.liferay.commerce.account.exception.NoSuchAccountOrganizationRelException {
return getPersistence()
.findByOrganizationId_PrevAndNext(commerceAccountOrganizationRelPK,
organizationId, orderByComparator);
}
|
class class_name[name] begin[{]
method[findByOrganizationId_PrevAndNext, return_type[type[CommerceAccountOrganizationRel]], modifier[public static], parameter[commerceAccountOrganizationRelPK, organizationId, orderByComparator]] begin[{]
return[call[.getPersistence, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[CommerceAccountOrganizationRel] operator[SEP] operator[SEP] identifier[findByOrganizationId_PrevAndNext] operator[SEP] identifier[CommerceAccountOrganizationRelPK] identifier[commerceAccountOrganizationRelPK] , Keyword[long] identifier[organizationId] , identifier[OrderByComparator] operator[<] identifier[CommerceAccountOrganizationRel] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[account] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchAccountOrganizationRelException] {
Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByOrganizationId_PrevAndNext] operator[SEP] identifier[commerceAccountOrganizationRelPK] , identifier[organizationId] , identifier[orderByComparator] operator[SEP] operator[SEP]
}
|
public static <V> Node<V> findNodeByLabel(List<Node<V>> parents, String labelPrefix) {
return findNode(parents, new LabelPrefixPredicate<V>(labelPrefix));
}
|
class class_name[name] begin[{]
method[findNodeByLabel, return_type[type[Node]], modifier[public static], parameter[parents, labelPrefix]] begin[{]
return[call[.findNode, parameter[member[.parents], ClassCreator(arguments=[MemberReference(member=labelPrefix, 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=V, sub_type=None))], dimensions=None, name=LabelPrefixPredicate, sub_type=None))]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[V] operator[>] identifier[Node] operator[<] identifier[V] operator[>] identifier[findNodeByLabel] operator[SEP] identifier[List] operator[<] identifier[Node] operator[<] identifier[V] operator[>] operator[>] identifier[parents] , identifier[String] identifier[labelPrefix] operator[SEP] {
Keyword[return] identifier[findNode] operator[SEP] identifier[parents] , Keyword[new] identifier[LabelPrefixPredicate] operator[<] identifier[V] operator[>] operator[SEP] identifier[labelPrefix] operator[SEP] operator[SEP] operator[SEP]
}
|
public void format(final String format) {
FitDateHelper helper = DependencyManager.getOrCreate(FitDateHelper.class);
helper.setFormat(format);
}
|
class class_name[name] begin[{]
method[format, return_type[void], modifier[public], parameter[format]] begin[{]
local_variable[type[FitDateHelper], helper]
call[helper.setFormat, parameter[member[.format]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[format] operator[SEP] Keyword[final] identifier[String] identifier[format] operator[SEP] {
identifier[FitDateHelper] identifier[helper] operator[=] identifier[DependencyManager] operator[SEP] identifier[getOrCreate] operator[SEP] identifier[FitDateHelper] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[helper] operator[SEP] identifier[setFormat] operator[SEP] identifier[format] operator[SEP] operator[SEP]
}
|
public static final BindingManager create ( final Map<String, Object> data )
{
final BindingManager result = new BindingManager ();
result.addBinder ( new MapBinder ( data ) );
result.addBinder ( new BindingManagerBinder () );
return result;
}
|
class class_name[name] begin[{]
method[create, return_type[type[BindingManager]], modifier[final public static], parameter[data]] begin[{]
local_variable[type[BindingManager], result]
call[result.addBinder, parameter[ClassCreator(arguments=[MemberReference(member=data, 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=MapBinder, sub_type=None))]]
call[result.addBinder, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BindingManagerBinder, sub_type=None))]]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[final] identifier[BindingManager] identifier[create] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[data] operator[SEP] {
Keyword[final] identifier[BindingManager] identifier[result] operator[=] Keyword[new] identifier[BindingManager] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addBinder] operator[SEP] Keyword[new] identifier[MapBinder] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addBinder] operator[SEP] Keyword[new] identifier[BindingManagerBinder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
private static MimeType getParentMimeType(Resource resource) {
MimeType result = null;
if (resource != null && (resource = resource.getParent()) != null) {
ResourceHandle handle = ResourceHandle.use(resource);
result = getMimeType(handle.getProperty(ResourceUtil.PROP_MIME_TYPE, ""));
if (result == null) {
String filename = getResourceName(resource);
result = getMimeType(filename);
}
}
return result;
}
|
class class_name[name] begin[{]
method[getParentMimeType, return_type[type[MimeType]], modifier[private static], parameter[resource]] begin[{]
local_variable[type[MimeType], result]
if[binary_operation[binary_operation[member[.resource], !=, literal[null]], &&, binary_operation[assign[member[.resource], call[resource.getParent, parameter[]]], !=, literal[null]]]] begin[{]
local_variable[type[ResourceHandle], handle]
assign[member[.result], call[.getMimeType, parameter[call[handle.getProperty, parameter[member[ResourceUtil.PROP_MIME_TYPE], literal[""]]]]]]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
local_variable[type[String], filename]
assign[member[.result], call[.getMimeType, parameter[member[.filename]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}]
|
Keyword[private] Keyword[static] identifier[MimeType] identifier[getParentMimeType] operator[SEP] identifier[Resource] identifier[resource] operator[SEP] {
identifier[MimeType] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[resource] operator[!=] Other[null] operator[&&] operator[SEP] identifier[resource] operator[=] identifier[resource] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[ResourceHandle] identifier[handle] operator[=] identifier[ResourceHandle] operator[SEP] identifier[use] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[getMimeType] operator[SEP] identifier[handle] operator[SEP] identifier[getProperty] operator[SEP] identifier[ResourceUtil] operator[SEP] identifier[PROP_MIME_TYPE] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
identifier[String] identifier[filename] operator[=] identifier[getResourceName] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[getMimeType] operator[SEP] identifier[filename] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public CommandArgs<K, V> add(CommandKeyword keyword) {
LettuceAssert.notNull(keyword, "CommandKeyword must not be null");
singularArguments.add(ProtocolKeywordArgument.of(keyword));
return this;
}
|
class class_name[name] begin[{]
method[add, return_type[type[CommandArgs]], modifier[public], parameter[keyword]] begin[{]
call[LettuceAssert.notNull, parameter[member[.keyword], literal["CommandKeyword must not be null"]]]
call[singularArguments.add, parameter[call[ProtocolKeywordArgument.of, parameter[member[.keyword]]]]]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[CommandArgs] operator[<] identifier[K] , identifier[V] operator[>] identifier[add] operator[SEP] identifier[CommandKeyword] identifier[keyword] operator[SEP] {
identifier[LettuceAssert] operator[SEP] identifier[notNull] operator[SEP] identifier[keyword] , literal[String] operator[SEP] operator[SEP] identifier[singularArguments] operator[SEP] identifier[add] operator[SEP] identifier[ProtocolKeywordArgument] operator[SEP] identifier[of] operator[SEP] identifier[keyword] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@OptionDesc(longName = "style", shortName = "s",
description = "citation STYLE name (default: ieee)",
argumentName = "STYLE", argumentType = ArgumentType.STRING,
priority = 10)
public void setStyle(String style) {
this.style = style;
}
|
class class_name[name] begin[{]
method[setStyle, return_type[void], modifier[public], parameter[style]] begin[{]
assign[THIS[member[None.style]], member[.style]]
end[}]
END[}]
|
annotation[@] identifier[OptionDesc] operator[SEP] identifier[longName] operator[=] literal[String] , identifier[shortName] operator[=] literal[String] , identifier[description] operator[=] literal[String] , identifier[argumentName] operator[=] literal[String] , identifier[argumentType] operator[=] identifier[ArgumentType] operator[SEP] identifier[STRING] , identifier[priority] operator[=] Other[10] operator[SEP] Keyword[public] Keyword[void] identifier[setStyle] operator[SEP] identifier[String] identifier[style] operator[SEP] {
Keyword[this] operator[SEP] identifier[style] operator[=] identifier[style] operator[SEP]
}
|
public synchronized PacketBuilder withBoolean(final boolean b)
{
checkBuilt();
try
{
dataOutputStream.writeBoolean(b);
}
catch (final IOException e)
{
logger.error("Unable to add boolean: {} : {}", e.getClass(), e.getMessage());
}
return this;
}
|
class class_name[name] begin[{]
method[withBoolean, return_type[type[PacketBuilder]], modifier[synchronized public], parameter[b]] begin[{]
call[.checkBuilt, parameter[]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeBoolean, postfix_operators=[], prefix_operators=[], qualifier=dataOutputStream, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to add boolean: {} : {}"), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
return[THIS[]]
end[}]
END[}]
|
Keyword[public] Keyword[synchronized] identifier[PacketBuilder] identifier[withBoolean] operator[SEP] Keyword[final] Keyword[boolean] identifier[b] operator[SEP] {
identifier[checkBuilt] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[dataOutputStream] operator[SEP] identifier[writeBoolean] operator[SEP] identifier[b] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
private static HashSet<String> searchDirectoryForPattern(File dir,String A, String B)
throws Exception {
File[] files = dir.listFiles();
HashSet<String> pattern_set = new HashSet<String>();
for (int i = 0; i < files.length; i++) {
File f = files[i];
if (f.isDirectory()) {
pattern_set.addAll(searchDirectoryForPattern(f, A, B));
} else if (f.getName().endsWith(".txt")) {
Scanner sc = new Scanner(f);
while (sc.hasNext()) {
if (A.equals(sc.next())) {
String pattern = "";
int count = 0;
while (count <= MAX_INTER && sc.hasNext()) {
String curr = sc.next();
if (count >= MIN_INTER && B.equals(curr)) {
//add the String onto a Set of Strings containing the patterns
//System.err.println("adding pattern: " + pattern);
pattern_set.add(pattern);
break;
/*
for (int j = 0; j < count; j++) {
System.err.print(pattern[j] + " ");
}
System.err.print("\n");
*/
} else {
if (count > 0) {
pattern += " ";
}
pattern += curr;
count++;
}
}
}
}
}
}
return pattern_set;
}
|
class class_name[name] begin[{]
method[searchDirectoryForPattern, return_type[type[HashSet]], modifier[private static], parameter[dir, A, B]] begin[{]
local_variable[type[File], files]
local_variable[type[HashSet], pattern_set]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".txt")], member=endsWith, 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=[MemberReference(member=f, 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=Scanner, sub_type=None)), name=sc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Scanner, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=sc, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=A, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=pattern)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=count)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=sc, selectors=[], type_arguments=None), name=curr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MIN_INTER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=MethodInvocation(arguments=[MemberReference(member=curr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=B, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=curr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MemberReference(member=count, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=pattern_set, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_INTER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operandr=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=sc, selectors=[], type_arguments=None), operator=&&), label=None)]))]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=sc, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=A, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=B, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=searchDirectoryForPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=pattern_set, 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=files, 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[.pattern_set]]
end[}]
END[}]
|
Keyword[private] Keyword[static] identifier[HashSet] operator[<] identifier[String] operator[>] identifier[searchDirectoryForPattern] operator[SEP] identifier[File] identifier[dir] , identifier[String] identifier[A] , identifier[String] identifier[B] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[File] operator[SEP] operator[SEP] identifier[files] operator[=] identifier[dir] operator[SEP] identifier[listFiles] operator[SEP] operator[SEP] operator[SEP] identifier[HashSet] operator[<] identifier[String] operator[>] identifier[pattern_set] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[files] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[File] identifier[f] operator[=] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] {
identifier[pattern_set] operator[SEP] identifier[addAll] operator[SEP] identifier[searchDirectoryForPattern] operator[SEP] identifier[f] , identifier[A] , identifier[B] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[Scanner] identifier[sc] operator[=] Keyword[new] identifier[Scanner] operator[SEP] identifier[f] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[sc] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[A] operator[SEP] identifier[equals] operator[SEP] identifier[sc] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[pattern] operator[=] literal[String] operator[SEP] Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[count] operator[<=] identifier[MAX_INTER] operator[&&] identifier[sc] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[curr] operator[=] identifier[sc] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[count] operator[>=] identifier[MIN_INTER] operator[&&] identifier[B] operator[SEP] identifier[equals] operator[SEP] identifier[curr] operator[SEP] operator[SEP] {
identifier[pattern_set] operator[SEP] identifier[add] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[count] operator[>] Other[0] operator[SEP] {
identifier[pattern] operator[+=] literal[String] operator[SEP]
}
identifier[pattern] operator[+=] identifier[curr] operator[SEP] identifier[count] operator[++] operator[SEP]
}
}
}
}
}
}
Keyword[return] identifier[pattern_set] operator[SEP]
}
|
public void addSink(VehicleDataSink sink) {
Log.i(TAG, "Adding data sink " + sink);
mRemoteOriginPipeline.addSink(sink);
}
|
class class_name[name] begin[{]
method[addSink, return_type[void], modifier[public], parameter[sink]] begin[{]
call[Log.i, parameter[member[.TAG], binary_operation[literal["Adding data sink "], +, member[.sink]]]]
call[mRemoteOriginPipeline.addSink, parameter[member[.sink]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[addSink] operator[SEP] identifier[VehicleDataSink] identifier[sink] operator[SEP] {
identifier[Log] operator[SEP] identifier[i] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[sink] operator[SEP] operator[SEP] identifier[mRemoteOriginPipeline] operator[SEP] identifier[addSink] operator[SEP] identifier[sink] operator[SEP] operator[SEP]
}
|
private File getTempUploadDir() throws Exception {
if (m_tempUploadDir == null) {
try {
m_tempUploadDir = getServer().getUploadDir();
} catch (InitializationException e) {
throw new Exception("Unable to get server: " + e.getMessage(), e);
}
}
return m_tempUploadDir;
}
|
class class_name[name] begin[{]
method[getTempUploadDir, return_type[type[File]], modifier[private], parameter[]] begin[{]
if[binary_operation[member[.m_tempUploadDir], ==, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_tempUploadDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getUploadDir, 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=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to get server: "), 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=Exception, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InitializationException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[.m_tempUploadDir]]
end[}]
END[}]
|
Keyword[private] identifier[File] identifier[getTempUploadDir] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[m_tempUploadDir] operator[==] Other[null] operator[SEP] {
Keyword[try] {
identifier[m_tempUploadDir] operator[=] identifier[getServer] operator[SEP] operator[SEP] operator[SEP] identifier[getUploadDir] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InitializationException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[m_tempUploadDir] operator[SEP]
}
|
@NonNull
private static ObservableTransformer<Boolean, Boolean> onSubscribeSetText(Button button, @StringRes int textResId) {
return booleanObservable -> booleanObservable
.doOnSubscribe((disposable) -> button.setText(textResId))
.subscribeOn(AndroidSchedulers.mainThread());
}
|
class class_name[name] begin[{]
method[onSubscribeSetText, return_type[type[ObservableTransformer]], modifier[private static], parameter[button, textResId]] begin[{]
return[LambdaExpression(body=MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=textResId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setText, postfix_operators=[], prefix_operators=[], qualifier=button, selectors=[], type_arguments=None), parameters=[MemberReference(member=disposable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=doOnSubscribe, postfix_operators=[], prefix_operators=[], qualifier=booleanObservable, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=mainThread, postfix_operators=[], prefix_operators=[], qualifier=AndroidSchedulers, selectors=[], type_arguments=None)], member=subscribeOn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=booleanObservable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]
end[}]
END[}]
|
annotation[@] identifier[NonNull] Keyword[private] Keyword[static] identifier[ObservableTransformer] operator[<] identifier[Boolean] , identifier[Boolean] operator[>] identifier[onSubscribeSetText] operator[SEP] identifier[Button] identifier[button] , annotation[@] identifier[StringRes] Keyword[int] identifier[textResId] operator[SEP] {
Keyword[return] identifier[booleanObservable] operator[->] identifier[booleanObservable] operator[SEP] identifier[doOnSubscribe] operator[SEP] operator[SEP] identifier[disposable] operator[SEP] operator[->] identifier[button] operator[SEP] identifier[setText] operator[SEP] identifier[textResId] operator[SEP] operator[SEP] operator[SEP] identifier[subscribeOn] operator[SEP] identifier[AndroidSchedulers] operator[SEP] identifier[mainThread] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void validateConstraint(RuleSet ruleSet, Constraint constraint, Severity severity) throws RuleException {
if (!executedConstraints.contains(constraint)) {
if (applyRequiredConcepts(ruleSet, constraint)) {
ruleVisitor.visitConstraint(constraint, severity);
} else {
ruleVisitor.skipConstraint(constraint, severity);
}
executedConstraints.add(constraint);
}
}
|
class class_name[name] begin[{]
method[validateConstraint, return_type[void], modifier[private], parameter[ruleSet, constraint, severity]] begin[{]
if[call[executedConstraints.contains, parameter[member[.constraint]]]] begin[{]
if[call[.applyRequiredConcepts, parameter[member[.ruleSet], member[.constraint]]]] begin[{]
call[ruleVisitor.visitConstraint, parameter[member[.constraint], member[.severity]]]
else begin[{]
call[ruleVisitor.skipConstraint, parameter[member[.constraint], member[.severity]]]
end[}]
call[executedConstraints.add, parameter[member[.constraint]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[validateConstraint] operator[SEP] identifier[RuleSet] identifier[ruleSet] , identifier[Constraint] identifier[constraint] , identifier[Severity] identifier[severity] operator[SEP] Keyword[throws] identifier[RuleException] {
Keyword[if] operator[SEP] operator[!] identifier[executedConstraints] operator[SEP] identifier[contains] operator[SEP] identifier[constraint] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[applyRequiredConcepts] operator[SEP] identifier[ruleSet] , identifier[constraint] operator[SEP] operator[SEP] {
identifier[ruleVisitor] operator[SEP] identifier[visitConstraint] operator[SEP] identifier[constraint] , identifier[severity] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ruleVisitor] operator[SEP] identifier[skipConstraint] operator[SEP] identifier[constraint] , identifier[severity] operator[SEP] operator[SEP]
}
identifier[executedConstraints] operator[SEP] identifier[add] operator[SEP] identifier[constraint] operator[SEP] operator[SEP]
}
}
|
public static String getSIntA( int... intA ) {
//
String Info = "";
//
if ( intA == null ) return "?";
if ( intA.length == 0 ) return "?";
//
for ( int K = 0; K < intA.length; K ++ ) {
//
Info += ( Info.isEmpty() )? "" : ", ";
Info += BTools.getSInt( intA[ K ] );
}
//
return Info;
}
|
class class_name[name] begin[{]
method[getSIntA, return_type[type[String]], modifier[public static], parameter[intA]] begin[{]
local_variable[type[String], Info]
if[binary_operation[member[.intA], ==, literal[null]]] begin[{]
return[literal["?"]]
else begin[{]
None
end[}]
if[binary_operation[member[intA.length], ==, literal[0]]] begin[{]
return[literal["?"]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=Info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=TernaryExpression(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=Info, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", "), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=Info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=intA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=K, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getSInt, postfix_operators=[], prefix_operators=[], qualifier=BTools, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=K, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=intA, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=K)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=K, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.Info]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[getSIntA] operator[SEP] Keyword[int] operator[...] identifier[intA] operator[SEP] {
identifier[String] identifier[Info] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[intA] operator[==] Other[null] operator[SEP] Keyword[return] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[intA] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[return] literal[String] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[K] operator[=] Other[0] operator[SEP] identifier[K] operator[<] identifier[intA] operator[SEP] identifier[length] operator[SEP] identifier[K] operator[++] operator[SEP] {
identifier[Info] operator[+=] operator[SEP] identifier[Info] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] identifier[Info] operator[+=] identifier[BTools] operator[SEP] identifier[getSInt] operator[SEP] identifier[intA] operator[SEP] identifier[K] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Info] operator[SEP]
}
|
@Override
public int compareTo(final AbstractAttr<T> otherObj) {
if (otherObj == null) {
return 1;
} else {
return value.compareTo(otherObj.value);
}
}
|
class class_name[name] begin[{]
method[compareTo, return_type[type[int]], modifier[public], parameter[otherObj]] begin[{]
if[binary_operation[member[.otherObj], ==, literal[null]]] begin[{]
return[literal[1]]
else begin[{]
return[call[value.compareTo, parameter[member[otherObj.value]]]]
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compareTo] operator[SEP] Keyword[final] identifier[AbstractAttr] operator[<] identifier[T] operator[>] identifier[otherObj] operator[SEP] {
Keyword[if] operator[SEP] identifier[otherObj] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[1] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[value] operator[SEP] identifier[compareTo] operator[SEP] identifier[otherObj] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
|
protected final String exceptionMessage(String msg) {
if (msg == null) {
msg = "";
}
StringBuilder buf = new StringBuilder(128 + msg.length())
.append(protocol())
.append(", ")
.append(authScheme())
.append(", ")
.append(proxyAddress)
.append(" => ")
.append(destinationAddress);
if (!msg.isEmpty()) {
buf.append(", ").append(msg);
}
return buf.toString();
}
|
class class_name[name] begin[{]
method[exceptionMessage, return_type[type[String]], modifier[final protected], parameter[msg]] begin[{]
if[binary_operation[member[.msg], ==, literal[null]]] begin[{]
assign[member[.msg], literal[""]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], buf]
if[call[msg.isEmpty, parameter[]]] begin[{]
call[buf.append, parameter[literal[", "]]]
else begin[{]
None
end[}]
return[call[buf.toString, parameter[]]]
end[}]
END[}]
|
Keyword[protected] Keyword[final] identifier[String] identifier[exceptionMessage] operator[SEP] identifier[String] identifier[msg] operator[SEP] {
Keyword[if] operator[SEP] identifier[msg] operator[==] Other[null] operator[SEP] {
identifier[msg] operator[=] literal[String] operator[SEP]
}
identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[128] operator[+] identifier[msg] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[protocol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[authScheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[proxyAddress] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[destinationAddress] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[msg] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[msg] operator[SEP] operator[SEP]
}
Keyword[return] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static List<String> captureOutAndError(List<String> setup,
List<String> cmd,
File stdoutFilename,
File stderrFilename,
long tailLength,
boolean useSetsid
) throws IOException {
List<String> result = new ArrayList<String>(3);
result.add(bashCommand);
result.add("-c");
String mergedCmd = buildCommandLine(setup, cmd,
stdoutFilename,
stderrFilename, tailLength,
useSetsid);
result.add(mergedCmd.toString());
return result;
}
|
class class_name[name] begin[{]
method[captureOutAndError, return_type[type[List]], modifier[public static], parameter[setup, cmd, stdoutFilename, stderrFilename, tailLength, useSetsid]] begin[{]
local_variable[type[List], result]
call[result.add, parameter[member[.bashCommand]]]
call[result.add, parameter[literal["-c"]]]
local_variable[type[String], mergedCmd]
call[result.add, parameter[call[mergedCmd.toString, parameter[]]]]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[captureOutAndError] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[setup] , identifier[List] operator[<] identifier[String] operator[>] identifier[cmd] , identifier[File] identifier[stdoutFilename] , identifier[File] identifier[stderrFilename] , Keyword[long] identifier[tailLength] , Keyword[boolean] identifier[useSetsid] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[List] operator[<] identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[bashCommand] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[mergedCmd] operator[=] identifier[buildCommandLine] operator[SEP] identifier[setup] , identifier[cmd] , identifier[stdoutFilename] , identifier[stderrFilename] , identifier[tailLength] , identifier[useSetsid] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[mergedCmd] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public static boolean sendOnEvent(Object filter, FilterDescriptor descriptor, String id,
FilterEventParameters parameters) throws FilterException
{
FilterElementDescriptor elementDescriptor = descriptor.getElement(id);
if (elementDescriptor != null && elementDescriptor.getOnMethod() != null) {
sendEvent(elementDescriptor.getOnMethod(), elementDescriptor, filter, parameters);
} else if (filter instanceof UnknownFilter) {
((UnknownFilter) filter).onUnknwon(id, parameters);
} else {
return false;
}
return true;
}
|
class class_name[name] begin[{]
method[sendOnEvent, return_type[type[boolean]], modifier[public static], parameter[filter, descriptor, id, parameters]] begin[{]
local_variable[type[FilterElementDescriptor], elementDescriptor]
if[binary_operation[binary_operation[member[.elementDescriptor], !=, literal[null]], &&, binary_operation[call[elementDescriptor.getOnMethod, parameter[]], !=, literal[null]]]] begin[{]
call[.sendEvent, parameter[call[elementDescriptor.getOnMethod, parameter[]], member[.elementDescriptor], member[.filter], member[.parameters]]]
else begin[{]
if[binary_operation[member[.filter], instanceof, type[UnknownFilter]]] begin[{]
Cast(expression=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=UnknownFilter, sub_type=None))
else begin[{]
return[literal[false]]
end[}]
end[}]
return[literal[true]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[sendOnEvent] operator[SEP] identifier[Object] identifier[filter] , identifier[FilterDescriptor] identifier[descriptor] , identifier[String] identifier[id] , identifier[FilterEventParameters] identifier[parameters] operator[SEP] Keyword[throws] identifier[FilterException] {
identifier[FilterElementDescriptor] identifier[elementDescriptor] operator[=] identifier[descriptor] operator[SEP] identifier[getElement] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elementDescriptor] operator[!=] Other[null] operator[&&] identifier[elementDescriptor] operator[SEP] identifier[getOnMethod] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[sendEvent] operator[SEP] identifier[elementDescriptor] operator[SEP] identifier[getOnMethod] operator[SEP] operator[SEP] , identifier[elementDescriptor] , identifier[filter] , identifier[parameters] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[filter] Keyword[instanceof] identifier[UnknownFilter] operator[SEP] {
operator[SEP] operator[SEP] identifier[UnknownFilter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[onUnknwon] operator[SEP] identifier[id] , identifier[parameters] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public void changeRemoteDate(Application application, String strParams, CachedItem productItem, Date dateStart, Date dateEnd)
{
//+ this.setIcon(BaseApplet.getSharedInstance().loadImageIcon("tour/buttons/Lookup.gif", "Lookup"), CalendarConstants.START_ICON + 1);
//x this.setIcon(BaseApplet.getSharedInstance().loadImageIcon("tour/buttons/Price.gif", "Price"), CalendarConstants.START_ICON + 2);
productItem.setStatus(productItem.getStatus() | (1 << 2));
//+ this.setIcon(BaseApplet.getSharedInstance().loadImageIcon("tour/buttons/Inventory.gif", "Inventory"), CalendarConstants.START_ICON + 3);
//+ if (application == null)
//+ application = BaseApplet.getSharedInstance().getApplication();
// Step 1 - Send a message to the subscriber that I want to lookup the date, price, and inventory.
//+ CalendarDateChangeMessage message = new CalendarDateChangeMessage(strParams, productItem, dateStart, dateEnd);
// Step 2 - Listen for messages that modify this object's information
// I could potentially get 3 messages back: 1. chg date 2. set price 3. set avail.
// message.getModel();
//x application.getTaskScheduler().addTask(message);
//+ this.sendMessage(new CalendarDateChangeMessage(application, strParams, productItem, dateStart, dateEnd));
BaseApplet applet = BaseApplet.getSharedInstance();
try {
//+ if (database == null)
MessageSender sendQueue = null;
String strSendQueueName = "lookupHotelRate";
Map<String,Object> properties = new Hashtable<String,Object>();
properties.put("rateType", "Rack");
properties.put("roomClass", "Single");
MessageManager messageManager = applet.getApplication().getMessageManager();
sendQueue = messageManager.getMessageQueue(strSendQueueName, null).getMessageSender();
if (gbFirstTime)
{
BaseMessageReceiver handler = (BaseMessageReceiver)messageManager.getMessageQueue("sendHotelRate", null).getMessageReceiver();
/*?JMessageListener listener =*/ new CalendarMessageListener(handler, m_model);
gbFirstTime = false;
}
properties.put("correlationID", Integer.toString(this.hashCode()));
sendQueue.sendMessage(new MapMessage(null, properties)); // See ya!
} catch (Exception ex) {
ex.printStackTrace();
}
}
|
class class_name[name] begin[{]
method[changeRemoteDate, return_type[void], modifier[public], parameter[application, strParams, productItem, dateStart, dateEnd]] begin[{]
call[productItem.setStatus, parameter[binary_operation[call[productItem.getStatus, parameter[]], |, binary_operation[literal[1], <<, literal[2]]]]]
local_variable[type[BaseApplet], applet]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=sendQueue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MessageSender, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="lookupHotelRate"), name=strSendQueueName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Hashtable, sub_type=None)), name=properties)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rateType"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Rack")], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="roomClass"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Single")], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getApplication, postfix_operators=[], prefix_operators=[], qualifier=applet, selectors=[MethodInvocation(arguments=[], member=getMessageManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=messageManager)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MessageManager, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sendQueue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=strSendQueueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getMessageQueue, postfix_operators=[], prefix_operators=[], qualifier=messageManager, selectors=[MethodInvocation(arguments=[], member=getMessageSender, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=gbFirstTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sendHotelRate"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getMessageQueue, postfix_operators=[], prefix_operators=[], qualifier=messageManager, selectors=[MethodInvocation(arguments=[], member=getMessageReceiver, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=BaseMessageReceiver, sub_type=None)), name=handler)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BaseMessageReceiver, sub_type=None)), StatementExpression(expression=ClassCreator(arguments=[MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_model, 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=CalendarMessageListener, sub_type=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=gbFirstTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="correlationID"), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=hashCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MapMessage, sub_type=None))], member=sendMessage, postfix_operators=[], prefix_operators=[], qualifier=sendQueue, 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=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[changeRemoteDate] operator[SEP] identifier[Application] identifier[application] , identifier[String] identifier[strParams] , identifier[CachedItem] identifier[productItem] , identifier[Date] identifier[dateStart] , identifier[Date] identifier[dateEnd] operator[SEP] {
identifier[productItem] operator[SEP] identifier[setStatus] operator[SEP] identifier[productItem] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[|] operator[SEP] Other[1] operator[<<] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[BaseApplet] identifier[applet] operator[=] identifier[BaseApplet] operator[SEP] identifier[getSharedInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[MessageSender] identifier[sendQueue] operator[=] Other[null] operator[SEP] identifier[String] identifier[strSendQueueName] operator[=] literal[String] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[=] Keyword[new] identifier[Hashtable] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[MessageManager] identifier[messageManager] operator[=] identifier[applet] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] identifier[getMessageManager] operator[SEP] operator[SEP] operator[SEP] identifier[sendQueue] operator[=] identifier[messageManager] operator[SEP] identifier[getMessageQueue] operator[SEP] identifier[strSendQueueName] , Other[null] operator[SEP] operator[SEP] identifier[getMessageSender] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gbFirstTime] operator[SEP] {
identifier[BaseMessageReceiver] identifier[handler] operator[=] operator[SEP] identifier[BaseMessageReceiver] operator[SEP] identifier[messageManager] operator[SEP] identifier[getMessageQueue] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP] identifier[getMessageReceiver] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[CalendarMessageListener] operator[SEP] identifier[handler] , identifier[m_model] operator[SEP] operator[SEP] identifier[gbFirstTime] operator[=] literal[boolean] operator[SEP]
}
identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] Keyword[this] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sendQueue] operator[SEP] identifier[sendMessage] operator[SEP] Keyword[new] identifier[MapMessage] operator[SEP] Other[null] , identifier[properties] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static String getQuestionMark(int count) {
StringBuilder qMark = new StringBuilder();
for (int i = 0; i < count; i++) {
if(i > 0) {
qMark.append(", ");
}
qMark.append("?");
}
return qMark.toString();
}
|
class class_name[name] begin[{]
method[getQuestionMark, return_type[type[String]], modifier[public static], parameter[count]] begin[{]
local_variable[type[StringBuilder], qMark]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=qMark, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="?")], member=append, postfix_operators=[], prefix_operators=[], qualifier=qMark, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[qMark.toString, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[getQuestionMark] operator[SEP] Keyword[int] identifier[count] operator[SEP] {
identifier[StringBuilder] identifier[qMark] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] {
identifier[qMark] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[qMark] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[qMark] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <T> Func1<T, Observable<Object>> toEmpty() {
return Functions.constant(Observable.<Object> empty());
}
|
class class_name[name] begin[{]
method[toEmpty, return_type[type[Func1]], modifier[public static], parameter[]] begin[{]
return[call[Functions.constant, parameter[call[.Observable, parameter[]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Func1] operator[<] identifier[T] , identifier[Observable] operator[<] identifier[Object] operator[>] operator[>] identifier[toEmpty] operator[SEP] operator[SEP] {
Keyword[return] identifier[Functions] operator[SEP] identifier[constant] operator[SEP] identifier[Observable] operator[SEP] operator[<] identifier[Object] operator[>] identifier[empty] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static com.github.bordertech.wcomponents.Image createThumbnail(final InputStream is,
final String name,
final Dimension scaledSize, final String mimeType) {
final Dimension scale = scaledSize == null ? THUMBNAIL_SCALE_SIZE : scaledSize;
// Generate thumbnail for image files
if (is != null && mimeType != null && (mimeType.equals("image/jpeg") || mimeType.equals(
"image/bmp")
|| mimeType.equals("image/png") || mimeType.equals("image/gif"))) {
byte[] bytes = createImageThumbnail(is, scale);
if (bytes != null) {
return new BytesImage(bytes, "image/jpeg", "Thumbnail of " + name, null);
}
}
// Use default thumbnail depending on mime type
com.github.bordertech.wcomponents.Image image = handleDefaultImage(mimeType, name, scale);
return image;
}
|
class class_name[name] begin[{]
method[createThumbnail, return_type[type[com]], modifier[public static], parameter[is, name, scaledSize, mimeType]] begin[{]
local_variable[type[Dimension], scale]
if[binary_operation[binary_operation[binary_operation[member[.is], !=, literal[null]], &&, binary_operation[member[.mimeType], !=, literal[null]]], &&, binary_operation[binary_operation[binary_operation[call[mimeType.equals, parameter[literal["image/jpeg"]]], ||, call[mimeType.equals, parameter[literal["image/bmp"]]]], ||, call[mimeType.equals, parameter[literal["image/png"]]]], ||, call[mimeType.equals, parameter[literal["image/gif"]]]]]] begin[{]
local_variable[type[byte], bytes]
if[binary_operation[member[.bytes], !=, literal[null]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="image/jpeg"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Thumbnail of "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), 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=BytesImage, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[com], image]
return[member[.image]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[com] operator[SEP] identifier[github] operator[SEP] identifier[bordertech] operator[SEP] identifier[wcomponents] operator[SEP] identifier[Image] identifier[createThumbnail] operator[SEP] Keyword[final] identifier[InputStream] identifier[is] , Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[Dimension] identifier[scaledSize] , Keyword[final] identifier[String] identifier[mimeType] operator[SEP] {
Keyword[final] identifier[Dimension] identifier[scale] operator[=] identifier[scaledSize] operator[==] Other[null] operator[?] identifier[THUMBNAIL_SCALE_SIZE] operator[:] identifier[scaledSize] operator[SEP] Keyword[if] operator[SEP] identifier[is] operator[!=] Other[null] operator[&&] identifier[mimeType] operator[!=] Other[null] operator[&&] operator[SEP] identifier[mimeType] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[mimeType] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[mimeType] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[mimeType] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] identifier[createImageThumbnail] operator[SEP] identifier[is] , identifier[scale] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bytes] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[BytesImage] operator[SEP] identifier[bytes] , literal[String] , literal[String] operator[+] identifier[name] , Other[null] operator[SEP] operator[SEP]
}
}
identifier[com] operator[SEP] identifier[github] operator[SEP] identifier[bordertech] operator[SEP] identifier[wcomponents] operator[SEP] identifier[Image] identifier[image] operator[=] identifier[handleDefaultImage] operator[SEP] identifier[mimeType] , identifier[name] , identifier[scale] operator[SEP] operator[SEP] Keyword[return] identifier[image] operator[SEP]
}
|
public static void writeElementList(XMLOutput xmlOutput, String tagName, Iterator<String> listValueIterator)
throws IOException {
while (listValueIterator.hasNext()) {
xmlOutput.openTag(tagName);
xmlOutput.writeText(listValueIterator.next());
xmlOutput.closeTag(tagName);
}
}
|
class class_name[name] begin[{]
method[writeElementList, return_type[void], modifier[public static], parameter[xmlOutput, tagName, listValueIterator]] begin[{]
while[call[listValueIterator.hasNext, parameter[]]] begin[{]
call[xmlOutput.openTag, parameter[member[.tagName]]]
call[xmlOutput.writeText, parameter[call[listValueIterator.next, parameter[]]]]
call[xmlOutput.closeTag, parameter[member[.tagName]]]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[writeElementList] operator[SEP] identifier[XMLOutput] identifier[xmlOutput] , identifier[String] identifier[tagName] , identifier[Iterator] operator[<] identifier[String] operator[>] identifier[listValueIterator] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[while] operator[SEP] identifier[listValueIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[xmlOutput] operator[SEP] identifier[openTag] operator[SEP] identifier[tagName] operator[SEP] operator[SEP] identifier[xmlOutput] operator[SEP] identifier[writeText] operator[SEP] identifier[listValueIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[xmlOutput] operator[SEP] identifier[closeTag] operator[SEP] identifier[tagName] operator[SEP] operator[SEP]
}
}
|
public void respondUsing(final RespondWithBlob callback) throws IOException {
RespondWithData dataCallback = new RespondWithData() {
@Override
public Data onInterest(Name prefix, Interest interest) throws Exception {
Data data = new Data(interest.getName());
Blob content = callback.onInterest(prefix, interest);
data.setContent(content);
return data;
}
};
respondUsing(dataCallback);
}
|
class class_name[name] begin[{]
method[respondUsing, return_type[void], modifier[public], parameter[callback]] begin[{]
local_variable[type[RespondWithData], dataCallback]
call[.respondUsing, parameter[member[.dataCallback]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[respondUsing] operator[SEP] Keyword[final] identifier[RespondWithBlob] identifier[callback] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[RespondWithData] identifier[dataCallback] operator[=] Keyword[new] identifier[RespondWithData] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Data] identifier[onInterest] operator[SEP] identifier[Name] identifier[prefix] , identifier[Interest] identifier[interest] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[Data] identifier[data] operator[=] Keyword[new] identifier[Data] operator[SEP] identifier[interest] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Blob] identifier[content] operator[=] identifier[callback] operator[SEP] identifier[onInterest] operator[SEP] identifier[prefix] , identifier[interest] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[setContent] operator[SEP] identifier[content] operator[SEP] operator[SEP] Keyword[return] identifier[data] operator[SEP]
}
} operator[SEP] identifier[respondUsing] operator[SEP] identifier[dataCallback] operator[SEP] operator[SEP]
}
|
@Deprecated
public static String removeChars(String S, char ch) {
int pos;
while((pos=S.indexOf(ch))!=-1) S=S.substring(0,pos)+S.substring(pos+1);
return S;
}
|
class class_name[name] begin[{]
method[removeChars, return_type[type[String]], modifier[public static], parameter[S, ch]] begin[{]
local_variable[type[int], pos]
while[binary_operation[assign[member[.pos], call[S.indexOf, parameter[member[.ch]]]], !=, literal[1]]] begin[{]
assign[member[.S], binary_operation[call[S.substring, parameter[literal[0], member[.pos]]], +, call[S.substring, parameter[binary_operation[member[.pos], +, literal[1]]]]]]
end[}]
return[member[.S]]
end[}]
END[}]
|
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[String] identifier[removeChars] operator[SEP] identifier[String] identifier[S] , Keyword[char] identifier[ch] operator[SEP] {
Keyword[int] identifier[pos] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[pos] operator[=] identifier[S] operator[SEP] identifier[indexOf] operator[SEP] identifier[ch] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] identifier[S] operator[=] identifier[S] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[pos] operator[SEP] operator[+] identifier[S] operator[SEP] identifier[substring] operator[SEP] identifier[pos] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[S] operator[SEP]
}
|
public ServletInputStream getInputStream() throws IOException {
if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
logger.logp(Level.FINE, CLASS_NAME,"getInputStream", "this->"+this+": gotReader = " + _srtRequestHelper._gotReader);
}
if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
checkRequestObjectInUse();
}
// MultiRead Start
// if stream is currently closed, allow re-read.
// otherwise this must be the first read so register as an observer to be notified when close occurs.
if (this.multiReadPropertyEnabled) {
if (_srtRequestHelper._InputStreamClosed) {
((SRTInputStream) this._in).restart();
}
}
if (_srtRequestHelper._gotReader)
throw new IllegalStateException( liberty_nls.getString("Reader.already.obtained", "Reader already obtained"));
// MultiRead End
_srtRequestHelper._gotInputStream = true;
if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
logger.logp(Level.FINE, CLASS_NAME,"getInputStream", "stream->"+_in+": gotReader = " + _srtRequestHelper._gotReader);
}
return _in;
}
|
class class_name[name] begin[{]
method[getInputStream, return_type[type[ServletInputStream]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[logger.isLoggable, parameter[member[Level.FINE]]]]] begin[{]
call[logger.logp, parameter[member[Level.FINE], member[.CLASS_NAME], literal["getInputStream"], binary_operation[binary_operation[binary_operation[literal["this->"], +, THIS[]], +, literal[": gotReader = "]], +, member[_srtRequestHelper._gotReader]]]]
else begin[{]
None
end[}]
if[member[WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE]] begin[{]
call[.checkRequestObjectInUse, parameter[]]
else begin[{]
None
end[}]
if[THIS[member[None.multiReadPropertyEnabled]]] begin[{]
if[member[_srtRequestHelper._InputStreamClosed]] begin[{]
Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=_in, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type=ReferenceType(arguments=None, dimensions=[], name=SRTInputStream, sub_type=None))
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[member[_srtRequestHelper._gotReader]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Reader.already.obtained"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Reader already obtained")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=liberty_nls, selectors=[], type_arguments=None)], 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[}]
assign[member[_srtRequestHelper._gotInputStream], literal[true]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[logger.isLoggable, parameter[member[Level.FINE]]]]] begin[{]
call[logger.logp, parameter[member[Level.FINE], member[.CLASS_NAME], literal["getInputStream"], binary_operation[binary_operation[binary_operation[literal["stream->"], +, member[._in]], +, literal[": gotReader = "]], +, member[_srtRequestHelper._gotReader]]]]
else begin[{]
None
end[}]
return[member[._in]]
end[}]
END[}]
|
Keyword[public] identifier[ServletInputStream] identifier[getInputStream] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[+] Keyword[this] operator[+] literal[String] operator[+] identifier[_srtRequestHelper] operator[SEP] identifier[_gotReader] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[WCCustomProperties] operator[SEP] identifier[CHECK_REQUEST_OBJECT_IN_USE] operator[SEP] {
identifier[checkRequestObjectInUse] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[multiReadPropertyEnabled] operator[SEP] {
Keyword[if] operator[SEP] identifier[_srtRequestHelper] operator[SEP] identifier[_InputStreamClosed] operator[SEP] {
operator[SEP] operator[SEP] identifier[SRTInputStream] operator[SEP] Keyword[this] operator[SEP] identifier[_in] operator[SEP] operator[SEP] identifier[restart] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[_srtRequestHelper] operator[SEP] identifier[_gotReader] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[liberty_nls] operator[SEP] identifier[getString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[_srtRequestHelper] operator[SEP] identifier[_gotInputStream] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[+] identifier[_in] operator[+] literal[String] operator[+] identifier[_srtRequestHelper] operator[SEP] identifier[_gotReader] operator[SEP] operator[SEP]
}
Keyword[return] identifier[_in] operator[SEP]
}
|
public SDVariable convertToConstant(@NonNull SDVariable variable) {
convertToConstants(Collections.singletonList(variable));
return variable;
}
|
class class_name[name] begin[{]
method[convertToConstant, return_type[type[SDVariable]], modifier[public], parameter[variable]] begin[{]
call[.convertToConstants, parameter[call[Collections.singletonList, parameter[member[.variable]]]]]
return[member[.variable]]
end[}]
END[}]
|
Keyword[public] identifier[SDVariable] identifier[convertToConstant] operator[SEP] annotation[@] identifier[NonNull] identifier[SDVariable] identifier[variable] operator[SEP] {
identifier[convertToConstants] operator[SEP] identifier[Collections] operator[SEP] identifier[singletonList] operator[SEP] identifier[variable] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[variable] operator[SEP]
}
|
public YearMonth withChronologyRetainFields(Chronology newChronology) {
newChronology = DateTimeUtils.getChronology(newChronology);
newChronology = newChronology.withUTC();
if (newChronology == getChronology()) {
return this;
} else {
YearMonth newYearMonth = new YearMonth(this, newChronology);
newChronology.validate(newYearMonth, getValues());
return newYearMonth;
}
}
|
class class_name[name] begin[{]
method[withChronologyRetainFields, return_type[type[YearMonth]], modifier[public], parameter[newChronology]] begin[{]
assign[member[.newChronology], call[DateTimeUtils.getChronology, parameter[member[.newChronology]]]]
assign[member[.newChronology], call[newChronology.withUTC, parameter[]]]
if[binary_operation[member[.newChronology], ==, call[.getChronology, parameter[]]]] begin[{]
return[THIS[]]
else begin[{]
local_variable[type[YearMonth], newYearMonth]
call[newChronology.validate, parameter[member[.newYearMonth], call[.getValues, parameter[]]]]
return[member[.newYearMonth]]
end[}]
end[}]
END[}]
|
Keyword[public] identifier[YearMonth] identifier[withChronologyRetainFields] operator[SEP] identifier[Chronology] identifier[newChronology] operator[SEP] {
identifier[newChronology] operator[=] identifier[DateTimeUtils] operator[SEP] identifier[getChronology] operator[SEP] identifier[newChronology] operator[SEP] operator[SEP] identifier[newChronology] operator[=] identifier[newChronology] operator[SEP] identifier[withUTC] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newChronology] operator[==] identifier[getChronology] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP]
}
Keyword[else] {
identifier[YearMonth] identifier[newYearMonth] operator[=] Keyword[new] identifier[YearMonth] operator[SEP] Keyword[this] , identifier[newChronology] operator[SEP] operator[SEP] identifier[newChronology] operator[SEP] identifier[validate] operator[SEP] identifier[newYearMonth] , identifier[getValues] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[newYearMonth] operator[SEP]
}
}
|
@Override
public void afterPropertiesSet() {
if (this.blockingMongoOperations != null) {
IndexOperations indexOperations = this.blockingMongoOperations.indexOps(this.collectionName);
this.mongoSessionConverter.ensureIndexes(indexOperations);
}
}
|
class class_name[name] begin[{]
method[afterPropertiesSet, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[THIS[member[None.blockingMongoOperations]], !=, literal[null]]] begin[{]
local_variable[type[IndexOperations], indexOperations]
THIS[member[None.mongoSessionConverter]call[None.ensureIndexes, parameter[member[.indexOperations]]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[afterPropertiesSet] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[blockingMongoOperations] operator[!=] Other[null] operator[SEP] {
identifier[IndexOperations] identifier[indexOperations] operator[=] Keyword[this] operator[SEP] identifier[blockingMongoOperations] operator[SEP] identifier[indexOps] operator[SEP] Keyword[this] operator[SEP] identifier[collectionName] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[mongoSessionConverter] operator[SEP] identifier[ensureIndexes] operator[SEP] identifier[indexOperations] operator[SEP] operator[SEP]
}
}
|
public void initialize(CmsListInfoBean listInfo) {
m_dialogContent = new CmsFieldsetFormFieldPanel(listInfo, null);
m_dialogContent.addStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().highTextBoxes());
m_dialogContent.getFieldSet().setOpenerVisible(false);
m_dialogContent.getFieldSet().getElement().getStyle().setMarginTop(4, Style.Unit.PX);
setMainContent(m_dialogContent);
m_titleInput = new CmsTextBox();
m_titleInput.setTriggerChangeOnKeyPress(true);
m_titleInput.addValueChangeHandler(new ValueChangeHandler<String>() {
public void onValueChange(ValueChangeEvent<String> event) {
setOkEnabled(CmsStringUtil.isNotEmptyOrWhitespaceOnly(event.getValue()));
}
});
addInputRow(
org.opencms.ade.sitemap.client.Messages.get().key(
org.opencms.ade.sitemap.client.Messages.GUI_MODEL_PAGE_TITLE_LABEL_0),
m_titleInput);
m_descriptionInput = new CmsTextBox();
addDialogClose(null);
addInputRow(
org.opencms.ade.sitemap.client.Messages.get().key(
org.opencms.ade.sitemap.client.Messages.GUI_MODEL_PAGE_DESCRIPTION_LABEL_0),
m_descriptionInput);
CmsPushButton closeButton = new CmsPushButton();
closeButton.setText(Messages.get().key(Messages.GUI_CANCEL_0));
closeButton.setUseMinWidth(true);
closeButton.setButtonStyle(ButtonStyle.TEXT, ButtonColor.BLUE);
closeButton.addClickHandler(new ClickHandler() {
/**
* @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
*/
public void onClick(ClickEvent event) {
hide();
}
});
addButton(closeButton);
m_okButton = new CmsPushButton();
m_okButton.setText(Messages.get().key(Messages.GUI_OK_0));
m_okButton.setUseMinWidth(true);
m_okButton.setButtonStyle(ButtonStyle.TEXT, ButtonColor.RED);
m_okButton.addClickHandler(new ClickHandler() {
/**
* @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
*/
public void onClick(ClickEvent event) {
onOk();
}
});
addButton(m_okButton);
setOkEnabled(false);
m_dialogContent.truncate(METRICS_KEY, CmsPopup.DEFAULT_WIDTH - 20);
}
|
class class_name[name] begin[{]
method[initialize, return_type[void], modifier[public], parameter[listInfo]] begin[{]
assign[member[.m_dialogContent], ClassCreator(arguments=[MemberReference(member=listInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=CmsFieldsetFormFieldPanel, sub_type=None))]
call[m_dialogContent.addStyleName, parameter[call[I_CmsInputLayoutBundle.INSTANCE.inputCss, parameter[]]]]
call[m_dialogContent.getFieldSet, parameter[]]
call[m_dialogContent.getFieldSet, parameter[]]
call[.setMainContent, parameter[member[.m_dialogContent]]]
assign[member[.m_titleInput], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsTextBox, sub_type=None))]
call[m_titleInput.setTriggerChangeOnKeyPress, parameter[literal[true]]]
call[m_titleInput.addValueChangeHandler, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None)], member=isNotEmptyOrWhitespaceOnly, postfix_operators=[], prefix_operators=[], qualifier=CmsStringUtil, selectors=[], type_arguments=None)], member=setOkEnabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onValueChange, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=ValueChangeEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ValueChangeHandler, sub_type=None))]]
call[.addInputRow, parameter[call[org.opencms.ade.sitemap.client.Messages.get, parameter[]], member[.m_titleInput]]]
assign[member[.m_descriptionInput], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsTextBox, sub_type=None))]
call[.addDialogClose, parameter[literal[null]]]
call[.addInputRow, parameter[call[org.opencms.ade.sitemap.client.Messages.get, parameter[]], member[.m_descriptionInput]]]
local_variable[type[CmsPushButton], closeButton]
call[closeButton.setText, parameter[call[Messages.get, parameter[]]]]
call[closeButton.setUseMinWidth, parameter[literal[true]]]
call[closeButton.setButtonStyle, parameter[member[ButtonStyle.TEXT], member[ButtonColor.BLUE]]]
call[closeButton.addClickHandler, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=hide, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=/**
* @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
*/, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=None, dimensions=[], name=ClickEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClickHandler, sub_type=None))]]
call[.addButton, parameter[member[.closeButton]]]
assign[member[.m_okButton], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsPushButton, sub_type=None))]
call[m_okButton.setText, parameter[call[Messages.get, parameter[]]]]
call[m_okButton.setUseMinWidth, parameter[literal[true]]]
call[m_okButton.setButtonStyle, parameter[member[ButtonStyle.TEXT], member[ButtonColor.RED]]]
call[m_okButton.addClickHandler, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=onOk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=/**
* @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
*/, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=None, dimensions=[], name=ClickEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClickHandler, sub_type=None))]]
call[.addButton, parameter[member[.m_okButton]]]
call[.setOkEnabled, parameter[literal[false]]]
call[m_dialogContent.truncate, parameter[member[.METRICS_KEY], binary_operation[member[CmsPopup.DEFAULT_WIDTH], -, literal[20]]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[initialize] operator[SEP] identifier[CmsListInfoBean] identifier[listInfo] operator[SEP] {
identifier[m_dialogContent] operator[=] Keyword[new] identifier[CmsFieldsetFormFieldPanel] operator[SEP] identifier[listInfo] , Other[null] operator[SEP] operator[SEP] identifier[m_dialogContent] operator[SEP] identifier[addStyleName] operator[SEP] identifier[I_CmsInputLayoutBundle] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[inputCss] operator[SEP] operator[SEP] operator[SEP] identifier[highTextBoxes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_dialogContent] operator[SEP] identifier[getFieldSet] operator[SEP] operator[SEP] operator[SEP] identifier[setOpenerVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[m_dialogContent] operator[SEP] identifier[getFieldSet] operator[SEP] operator[SEP] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[setMarginTop] operator[SEP] Other[4] , identifier[Style] operator[SEP] identifier[Unit] operator[SEP] identifier[PX] operator[SEP] operator[SEP] identifier[setMainContent] operator[SEP] identifier[m_dialogContent] operator[SEP] operator[SEP] identifier[m_titleInput] operator[=] Keyword[new] identifier[CmsTextBox] operator[SEP] operator[SEP] operator[SEP] identifier[m_titleInput] operator[SEP] identifier[setTriggerChangeOnKeyPress] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[m_titleInput] operator[SEP] identifier[addValueChangeHandler] operator[SEP] Keyword[new] identifier[ValueChangeHandler] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onValueChange] operator[SEP] identifier[ValueChangeEvent] operator[<] identifier[String] operator[>] identifier[event] operator[SEP] {
identifier[setOkEnabled] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isNotEmptyOrWhitespaceOnly] operator[SEP] identifier[event] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[addInputRow] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[ade] operator[SEP] identifier[sitemap] operator[SEP] identifier[client] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[ade] operator[SEP] identifier[sitemap] operator[SEP] identifier[client] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_MODEL_PAGE_TITLE_LABEL_0] operator[SEP] , identifier[m_titleInput] operator[SEP] operator[SEP] identifier[m_descriptionInput] operator[=] Keyword[new] identifier[CmsTextBox] operator[SEP] operator[SEP] operator[SEP] identifier[addDialogClose] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[addInputRow] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[ade] operator[SEP] identifier[sitemap] operator[SEP] identifier[client] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[ade] operator[SEP] identifier[sitemap] operator[SEP] identifier[client] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_MODEL_PAGE_DESCRIPTION_LABEL_0] operator[SEP] , identifier[m_descriptionInput] operator[SEP] operator[SEP] identifier[CmsPushButton] identifier[closeButton] operator[=] Keyword[new] identifier[CmsPushButton] operator[SEP] operator[SEP] operator[SEP] identifier[closeButton] operator[SEP] identifier[setText] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_CANCEL_0] operator[SEP] operator[SEP] operator[SEP] identifier[closeButton] operator[SEP] identifier[setUseMinWidth] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[closeButton] operator[SEP] identifier[setButtonStyle] operator[SEP] identifier[ButtonStyle] operator[SEP] identifier[TEXT] , identifier[ButtonColor] operator[SEP] identifier[BLUE] operator[SEP] operator[SEP] identifier[closeButton] operator[SEP] identifier[addClickHandler] operator[SEP] Keyword[new] identifier[ClickHandler] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[ClickEvent] identifier[event] operator[SEP] {
identifier[hide] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[addButton] operator[SEP] identifier[closeButton] operator[SEP] operator[SEP] identifier[m_okButton] operator[=] Keyword[new] identifier[CmsPushButton] operator[SEP] operator[SEP] operator[SEP] identifier[m_okButton] operator[SEP] identifier[setText] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_OK_0] operator[SEP] operator[SEP] operator[SEP] identifier[m_okButton] operator[SEP] identifier[setUseMinWidth] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[m_okButton] operator[SEP] identifier[setButtonStyle] operator[SEP] identifier[ButtonStyle] operator[SEP] identifier[TEXT] , identifier[ButtonColor] operator[SEP] identifier[RED] operator[SEP] operator[SEP] identifier[m_okButton] operator[SEP] identifier[addClickHandler] operator[SEP] Keyword[new] identifier[ClickHandler] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[ClickEvent] identifier[event] operator[SEP] {
identifier[onOk] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[addButton] operator[SEP] identifier[m_okButton] operator[SEP] operator[SEP] identifier[setOkEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[m_dialogContent] operator[SEP] identifier[truncate] operator[SEP] identifier[METRICS_KEY] , identifier[CmsPopup] operator[SEP] identifier[DEFAULT_WIDTH] operator[-] Other[20] operator[SEP] operator[SEP]
}
|
public SingleOutputStreamOperator<T> sum(int positionToSum) {
return aggregate(new SumAggregator<>(positionToSum, input.getType(), input.getExecutionConfig()));
}
|
class class_name[name] begin[{]
method[sum, return_type[type[SingleOutputStreamOperator]], modifier[public], parameter[positionToSum]] begin[{]
return[call[.aggregate, parameter[ClassCreator(arguments=[MemberReference(member=positionToSum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getExecutionConfig, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=SumAggregator, sub_type=None))]]]
end[}]
END[}]
|
Keyword[public] identifier[SingleOutputStreamOperator] operator[<] identifier[T] operator[>] identifier[sum] operator[SEP] Keyword[int] identifier[positionToSum] operator[SEP] {
Keyword[return] identifier[aggregate] operator[SEP] Keyword[new] identifier[SumAggregator] operator[<] operator[>] operator[SEP] identifier[positionToSum] , identifier[input] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[input] operator[SEP] identifier[getExecutionConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void export(Writer output, DirectedGraph<V, E> g) {
export(output, g, true);
}
|
class class_name[name] begin[{]
method[export, return_type[void], modifier[public], parameter[output, g]] begin[{]
call[.export, parameter[member[.output], member[.g], literal[true]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[export] operator[SEP] identifier[Writer] identifier[output] , identifier[DirectedGraph] operator[<] identifier[V] , identifier[E] operator[>] identifier[g] operator[SEP] {
identifier[export] operator[SEP] identifier[output] , identifier[g] , literal[boolean] operator[SEP] operator[SEP]
}
|
public void registerMemoryNotifications(NotificationListener notificationListener, Object handback)
{
NotificationEmitter emitter = (NotificationEmitter) this.getMemory();
emitter.addNotificationListener(notificationListener, null, handback);
}
|
class class_name[name] begin[{]
method[registerMemoryNotifications, return_type[void], modifier[public], parameter[notificationListener, handback]] begin[{]
local_variable[type[NotificationEmitter], emitter]
call[emitter.addNotificationListener, parameter[member[.notificationListener], literal[null], member[.handback]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[registerMemoryNotifications] operator[SEP] identifier[NotificationListener] identifier[notificationListener] , identifier[Object] identifier[handback] operator[SEP] {
identifier[NotificationEmitter] identifier[emitter] operator[=] operator[SEP] identifier[NotificationEmitter] operator[SEP] Keyword[this] operator[SEP] identifier[getMemory] operator[SEP] operator[SEP] operator[SEP] identifier[emitter] operator[SEP] identifier[addNotificationListener] operator[SEP] identifier[notificationListener] , Other[null] , identifier[handback] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("rawtypes")
public static void configure(
Configuration conf,
String qualifiedOutputTableId,
BigQueryTableSchema outputTableSchema,
String outputGcsPath,
BigQueryFileFormat outputFileFormat,
Class<? extends FileOutputFormat> outputFormatClass)
throws IOException {
configure(
conf,
qualifiedOutputTableId,
BigQueryTableHelper.getTableSchemaJson(outputTableSchema.get()),
outputGcsPath,
outputFileFormat,
outputFormatClass);
}
|
class class_name[name] begin[{]
method[configure, return_type[void], modifier[public static], parameter[conf, qualifiedOutputTableId, outputTableSchema, outputGcsPath, outputFileFormat, outputFormatClass]] begin[{]
call[.configure, parameter[member[.conf], member[.qualifiedOutputTableId], call[BigQueryTableHelper.getTableSchemaJson, parameter[call[outputTableSchema.get, parameter[]]]], member[.outputGcsPath], member[.outputFileFormat], member[.outputFormatClass]]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] Keyword[void] identifier[configure] operator[SEP] identifier[Configuration] identifier[conf] , identifier[String] identifier[qualifiedOutputTableId] , identifier[BigQueryTableSchema] identifier[outputTableSchema] , identifier[String] identifier[outputGcsPath] , identifier[BigQueryFileFormat] identifier[outputFileFormat] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[FileOutputFormat] operator[>] identifier[outputFormatClass] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[configure] operator[SEP] identifier[conf] , identifier[qualifiedOutputTableId] , identifier[BigQueryTableHelper] operator[SEP] identifier[getTableSchemaJson] operator[SEP] identifier[outputTableSchema] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] , identifier[outputGcsPath] , identifier[outputFileFormat] , identifier[outputFormatClass] operator[SEP] operator[SEP]
}
|
@Override
public List<PhoneNumber> searchForNumbers(String country, PhoneNumberSearchFilters listFilters) {
Locale locale = new Locale("en",country);
String iso3Country = locale.getISO3Country();
if(logger.isDebugEnabled()) {
logger.debug("searchPattern " + listFilters.getFilterPattern());
}
Client jerseyClient = Client.create();
jerseyClient.addFilter(new HTTPBasicAuthFilter(username, password));
WebResource webResource = jerseyClient.resource(searchURI);
// https://developers.voxbone.com/docs/v3/inventory#path__didgroup.html
webResource = webResource.queryParam(COUNTRY_CODE_PARAM,iso3Country);
// Pattern filterPattern = listFilters.getFilterPattern();
// if(filterPattern != null) {
// webResource = webResource.queryParam("cityNamePattern" , filterPattern.toString());
// }
if(listFilters.getAreaCode() != null) {
webResource = webResource.queryParam("areaCode", listFilters.getAreaCode());
}
if(listFilters.getInRateCenter() != null) {
webResource = webResource.queryParam("rateCenter", listFilters.getInRateCenter());
}
if(listFilters.getSmsEnabled() != null) {
webResource = webResource.queryParam("featureIds", "6");
}
if(listFilters.getFaxEnabled() != null) {
webResource = webResource.queryParam("featureIds", "25");
}
if(listFilters.getRangeIndex() != -1) {
webResource = webResource.queryParam(PAGE_NUMBER, "" + listFilters.getRangeIndex());
} else {
webResource = webResource.queryParam(PAGE_NUMBER, "0");
}
if(listFilters.getRangeSize() != -1) {
webResource = webResource.queryParam(PAGE_SIZE, "" + listFilters.getRangeSize());
} else {
webResource = webResource.queryParam(PAGE_SIZE, "50");
}
ClientResponse clientResponse = webResource.accept(CONTENT_TYPE).type(CONTENT_TYPE)
.get(ClientResponse.class);
String response = clientResponse.getEntity(String.class);
if(logger.isDebugEnabled())
logger.debug("response " + response);
JsonParser parser = new JsonParser();
JsonObject jsonResponse = parser.parse(response).getAsJsonObject();
// long count = jsonResponse.getAsJsonPrimitive("count").getAsLong();
// if(logger.isDebugEnabled()) {
// logger.debug("Number of numbers found : "+count);
// }
JsonArray voxboneNumbers = jsonResponse.getAsJsonArray("didGroups");
final List<PhoneNumber> numbers = toAvailablePhoneNumbers(voxboneNumbers, listFilters);
return numbers;
// } else {
// logger.warn("Couldn't reach uri for getting Phone Numbers. Response status was: "+response.getStatusLine().getStatusCode());
// }
//
// return new ArrayList<PhoneNumber>();
}
|
class class_name[name] begin[{]
method[searchForNumbers, return_type[type[List]], modifier[public], parameter[country, listFilters]] begin[{]
local_variable[type[Locale], locale]
local_variable[type[String], iso3Country]
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[binary_operation[literal["searchPattern "], +, call[listFilters.getFilterPattern, parameter[]]]]]
else begin[{]
None
end[}]
local_variable[type[Client], jerseyClient]
call[jerseyClient.addFilter, parameter[ClassCreator(arguments=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=password, 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=HTTPBasicAuthFilter, sub_type=None))]]
local_variable[type[WebResource], webResource]
assign[member[.webResource], call[webResource.queryParam, parameter[member[.COUNTRY_CODE_PARAM], member[.iso3Country]]]]
if[binary_operation[call[listFilters.getAreaCode, parameter[]], !=, literal[null]]] begin[{]
assign[member[.webResource], call[webResource.queryParam, parameter[literal["areaCode"], call[listFilters.getAreaCode, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[call[listFilters.getInRateCenter, parameter[]], !=, literal[null]]] begin[{]
assign[member[.webResource], call[webResource.queryParam, parameter[literal["rateCenter"], call[listFilters.getInRateCenter, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[call[listFilters.getSmsEnabled, parameter[]], !=, literal[null]]] begin[{]
assign[member[.webResource], call[webResource.queryParam, parameter[literal["featureIds"], literal["6"]]]]
else begin[{]
None
end[}]
if[binary_operation[call[listFilters.getFaxEnabled, parameter[]], !=, literal[null]]] begin[{]
assign[member[.webResource], call[webResource.queryParam, parameter[literal["featureIds"], literal["25"]]]]
else begin[{]
None
end[}]
if[binary_operation[call[listFilters.getRangeIndex, parameter[]], !=, literal[1]]] begin[{]
assign[member[.webResource], call[webResource.queryParam, parameter[member[.PAGE_NUMBER], binary_operation[literal[""], +, call[listFilters.getRangeIndex, parameter[]]]]]]
else begin[{]
assign[member[.webResource], call[webResource.queryParam, parameter[member[.PAGE_NUMBER], literal["0"]]]]
end[}]
if[binary_operation[call[listFilters.getRangeSize, parameter[]], !=, literal[1]]] begin[{]
assign[member[.webResource], call[webResource.queryParam, parameter[member[.PAGE_SIZE], binary_operation[literal[""], +, call[listFilters.getRangeSize, parameter[]]]]]]
else begin[{]
assign[member[.webResource], call[webResource.queryParam, parameter[member[.PAGE_SIZE], literal["50"]]]]
end[}]
local_variable[type[ClientResponse], clientResponse]
local_variable[type[String], response]
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[binary_operation[literal["response "], +, member[.response]]]]
else begin[{]
None
end[}]
local_variable[type[JsonParser], parser]
local_variable[type[JsonObject], jsonResponse]
local_variable[type[JsonArray], voxboneNumbers]
local_variable[type[List], numbers]
return[member[.numbers]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[PhoneNumber] operator[>] identifier[searchForNumbers] operator[SEP] identifier[String] identifier[country] , identifier[PhoneNumberSearchFilters] identifier[listFilters] operator[SEP] {
identifier[Locale] identifier[locale] operator[=] Keyword[new] identifier[Locale] operator[SEP] literal[String] , identifier[country] operator[SEP] operator[SEP] identifier[String] identifier[iso3Country] operator[=] identifier[locale] operator[SEP] identifier[getISO3Country] operator[SEP] 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[listFilters] operator[SEP] identifier[getFilterPattern] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Client] identifier[jerseyClient] operator[=] identifier[Client] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[jerseyClient] operator[SEP] identifier[addFilter] operator[SEP] Keyword[new] identifier[HTTPBasicAuthFilter] operator[SEP] identifier[username] , identifier[password] operator[SEP] operator[SEP] operator[SEP] identifier[WebResource] identifier[webResource] operator[=] identifier[jerseyClient] operator[SEP] identifier[resource] operator[SEP] identifier[searchURI] operator[SEP] operator[SEP] identifier[webResource] operator[=] identifier[webResource] operator[SEP] identifier[queryParam] operator[SEP] identifier[COUNTRY_CODE_PARAM] , identifier[iso3Country] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[listFilters] operator[SEP] identifier[getAreaCode] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[webResource] operator[=] identifier[webResource] operator[SEP] identifier[queryParam] operator[SEP] literal[String] , identifier[listFilters] operator[SEP] identifier[getAreaCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[listFilters] operator[SEP] identifier[getInRateCenter] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[webResource] operator[=] identifier[webResource] operator[SEP] identifier[queryParam] operator[SEP] literal[String] , identifier[listFilters] operator[SEP] identifier[getInRateCenter] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[listFilters] operator[SEP] identifier[getSmsEnabled] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[webResource] operator[=] identifier[webResource] operator[SEP] identifier[queryParam] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[listFilters] operator[SEP] identifier[getFaxEnabled] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[webResource] operator[=] identifier[webResource] operator[SEP] identifier[queryParam] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[listFilters] operator[SEP] identifier[getRangeIndex] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[webResource] operator[=] identifier[webResource] operator[SEP] identifier[queryParam] operator[SEP] identifier[PAGE_NUMBER] , literal[String] operator[+] identifier[listFilters] operator[SEP] identifier[getRangeIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[webResource] operator[=] identifier[webResource] operator[SEP] identifier[queryParam] operator[SEP] identifier[PAGE_NUMBER] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[listFilters] operator[SEP] identifier[getRangeSize] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[webResource] operator[=] identifier[webResource] operator[SEP] identifier[queryParam] operator[SEP] identifier[PAGE_SIZE] , literal[String] operator[+] identifier[listFilters] operator[SEP] identifier[getRangeSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[webResource] operator[=] identifier[webResource] operator[SEP] identifier[queryParam] operator[SEP] identifier[PAGE_SIZE] , literal[String] operator[SEP] operator[SEP]
}
identifier[ClientResponse] identifier[clientResponse] operator[=] identifier[webResource] operator[SEP] identifier[accept] operator[SEP] identifier[CONTENT_TYPE] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[CONTENT_TYPE] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[ClientResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[String] identifier[response] operator[=] identifier[clientResponse] operator[SEP] identifier[getEntity] operator[SEP] identifier[String] operator[SEP] Keyword[class] 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[response] operator[SEP] operator[SEP] identifier[JsonParser] identifier[parser] operator[=] Keyword[new] identifier[JsonParser] operator[SEP] operator[SEP] operator[SEP] identifier[JsonObject] identifier[jsonResponse] operator[=] identifier[parser] operator[SEP] identifier[parse] operator[SEP] identifier[response] operator[SEP] operator[SEP] identifier[getAsJsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[JsonArray] identifier[voxboneNumbers] operator[=] identifier[jsonResponse] operator[SEP] identifier[getAsJsonArray] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[PhoneNumber] operator[>] identifier[numbers] operator[=] identifier[toAvailablePhoneNumbers] operator[SEP] identifier[voxboneNumbers] , identifier[listFilters] operator[SEP] operator[SEP] Keyword[return] identifier[numbers] operator[SEP]
}
|
@Override
public void handleChannelData(final JSONObject jsonObject) throws BitfinexClientException {
final String channelType = jsonObject.getString("channel");
final int channelId = jsonObject.getInt("chanId");
BitfinexStreamSymbol symbol = null;
switch (channelType) {
case "ticker":
symbol = handleTickerCallback(jsonObject);
break;
case "trades":
symbol = handleTradesCallback(jsonObject);
break;
case "candles":
symbol = handleCandlesCallback(jsonObject);
break;
case "book":
symbol = handleBookCallback(jsonObject);
break;
default:
logger.error("Unknown subscribed callback {}", jsonObject.toString());
}
if (symbol != null) {
subscribeResultConsumer.accept(channelId, symbol);
}
}
|
class class_name[name] begin[{]
method[handleChannelData, return_type[void], modifier[public], parameter[jsonObject]] begin[{]
local_variable[type[String], channelType]
local_variable[type[int], channelId]
local_variable[type[BitfinexStreamSymbol], symbol]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ticker")], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=symbol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=jsonObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleTickerCallback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="trades")], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=symbol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=jsonObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleTradesCallback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="candles")], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=symbol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=jsonObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleCandlesCallback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="book")], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=symbol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=jsonObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleBookCallback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown subscribed callback {}"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=jsonObject, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=channelType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
if[binary_operation[member[.symbol], !=, literal[null]]] begin[{]
call[subscribeResultConsumer.accept, parameter[member[.channelId], member[.symbol]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handleChannelData] operator[SEP] Keyword[final] identifier[JSONObject] identifier[jsonObject] operator[SEP] Keyword[throws] identifier[BitfinexClientException] {
Keyword[final] identifier[String] identifier[channelType] operator[=] identifier[jsonObject] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[channelId] operator[=] identifier[jsonObject] operator[SEP] identifier[getInt] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[BitfinexStreamSymbol] identifier[symbol] operator[=] Other[null] operator[SEP] Keyword[switch] operator[SEP] identifier[channelType] operator[SEP] {
Keyword[case] literal[String] operator[:] identifier[symbol] operator[=] identifier[handleTickerCallback] operator[SEP] identifier[jsonObject] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[symbol] operator[=] identifier[handleTradesCallback] operator[SEP] identifier[jsonObject] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[symbol] operator[=] identifier[handleCandlesCallback] operator[SEP] identifier[jsonObject] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[symbol] operator[=] identifier[handleBookCallback] operator[SEP] identifier[jsonObject] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[jsonObject] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[symbol] operator[!=] Other[null] operator[SEP] {
identifier[subscribeResultConsumer] operator[SEP] identifier[accept] operator[SEP] identifier[channelId] , identifier[symbol] operator[SEP] operator[SEP]
}
}
|
public static void fire(final HasShowHandlers source) {
if (TYPE != null) {
ShowEvent event = new ShowEvent();
source.fireEvent(event);
}
}
|
class class_name[name] begin[{]
method[fire, return_type[void], modifier[public static], parameter[source]] begin[{]
if[binary_operation[member[.TYPE], !=, literal[null]]] begin[{]
local_variable[type[ShowEvent], event]
call[source.fireEvent, parameter[member[.event]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[fire] operator[SEP] Keyword[final] identifier[HasShowHandlers] identifier[source] operator[SEP] {
Keyword[if] operator[SEP] identifier[TYPE] operator[!=] Other[null] operator[SEP] {
identifier[ShowEvent] identifier[event] operator[=] Keyword[new] identifier[ShowEvent] operator[SEP] operator[SEP] operator[SEP] identifier[source] operator[SEP] identifier[fireEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP]
}
}
|
User replaceUser(String id, User user, AccessToken accessToken) {
if (user == null) {
throw new InvalidAttributeException("The given User can't be null.");
}
if (Strings.isNullOrEmpty(id)) {
throw new InvalidAttributeException("The given User ID can't be null or empty.");
}
return replaceResource(id, user, accessToken);
}
|
class class_name[name] begin[{]
method[replaceUser, return_type[type[User]], modifier[default], parameter[id, user, accessToken]] begin[{]
if[binary_operation[member[.user], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The given User can't be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidAttributeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[Strings.isNullOrEmpty, parameter[member[.id]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The given User ID can't be null or empty.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidAttributeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[.replaceResource, parameter[member[.id], member[.user], member[.accessToken]]]]
end[}]
END[}]
|
identifier[User] identifier[replaceUser] operator[SEP] identifier[String] identifier[id] , identifier[User] identifier[user] , identifier[AccessToken] identifier[accessToken] operator[SEP] {
Keyword[if] operator[SEP] identifier[user] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidAttributeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[id] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidAttributeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[replaceResource] operator[SEP] identifier[id] , identifier[user] , identifier[accessToken] operator[SEP] operator[SEP]
}
|
void removePathAndBlocks(String src, List<BlockInfo> blocks) throws IOException {
// No need for lock until we start accepting requests from clients.
assert (!nameNode.isRpcServerRunning() || hasWriteLock());
leaseManager.removeLeaseWithPrefixPath(src);
removeBlocks(blocks);
}
|
class class_name[name] begin[{]
method[removePathAndBlocks, return_type[void], modifier[default], parameter[src, blocks]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isRpcServerRunning, postfix_operators=[], prefix_operators=['!'], qualifier=nameNode, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=hasWriteLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=||), label=None, value=None)
call[leaseManager.removeLeaseWithPrefixPath, parameter[member[.src]]]
call[.removeBlocks, parameter[member[.blocks]]]
end[}]
END[}]
|
Keyword[void] identifier[removePathAndBlocks] operator[SEP] identifier[String] identifier[src] , identifier[List] operator[<] identifier[BlockInfo] operator[>] identifier[blocks] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[assert] operator[SEP] operator[!] identifier[nameNode] operator[SEP] identifier[isRpcServerRunning] operator[SEP] operator[SEP] operator[||] identifier[hasWriteLock] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[leaseManager] operator[SEP] identifier[removeLeaseWithPrefixPath] operator[SEP] identifier[src] operator[SEP] operator[SEP] identifier[removeBlocks] operator[SEP] identifier[blocks] operator[SEP] operator[SEP]
}
|
public void openWithParents(CmsTreeItem item) {
if (item != null) {
item.setOpen(true);
openWithParents(item.getParentItem());
}
}
|
class class_name[name] begin[{]
method[openWithParents, return_type[void], modifier[public], parameter[item]] begin[{]
if[binary_operation[member[.item], !=, literal[null]]] begin[{]
call[item.setOpen, parameter[literal[true]]]
call[.openWithParents, parameter[call[item.getParentItem, parameter[]]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[openWithParents] operator[SEP] identifier[CmsTreeItem] identifier[item] operator[SEP] {
Keyword[if] operator[SEP] identifier[item] operator[!=] Other[null] operator[SEP] {
identifier[item] operator[SEP] identifier[setOpen] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[openWithParents] operator[SEP] identifier[item] operator[SEP] identifier[getParentItem] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void process(List<ChessboardCorner> corners ) {
this.corners = corners;
// reset internal data structures
vertexes.reset();
edges.reset();
clusters.reset();
// Create a vertex for each corner
for (int idx = 0; idx < corners.size(); idx++) {
Vertex v = vertexes.grow();
v.reset();
v.index = idx;
}
// Initialize nearest-neighbor search.
nn.setPoints(corners,true);
// Connect corners to each other based on relative distance on orientation
for (int i = 0; i < corners.size(); i++) {
findVertexNeighbors(vertexes.get(i),corners);
}
// If more than one vertex's are near each other, pick one and remove the others
handleAmbiguousVertexes(corners);
// printDualGraph();
// Prune connections which are not mutual
for (int i = 0; i < vertexes.size; i++) {
Vertex v = vertexes.get(i);
v.pruneNonMutal(EdgeType.PARALLEL);
v.pruneNonMutal(EdgeType.PERPENDICULAR);
}
// printDualGraph();
// Select the final 2 to 4 connections from perpendicular set
// each pair of adjacent perpendicular edge needs to have a matching parallel edge between them
// Use each perpendicular edge as a seed and select the best one
for (int idx = 0; idx < vertexes.size(); idx++) {
selectConnections(vertexes.get(idx));
}
// printConnectionGraph();
// Connects must be mutual to be accepted. Keep track of vertexes which were modified
dirtyVertexes.clear();
for (int i = 0; i < vertexes.size; i++) {
Vertex v = vertexes.get(i);
int before = v.connections.size();
v.pruneNonMutal(EdgeType.CONNECTION);
if( before != v.connections.size() ) {
dirtyVertexes.add(v);
v.marked = true;
}
}
// printConnectionGraph();
// attempt to recover from poorly made decisions in the past from the greedy algorithm
repairVertexes();
// Prune non-mutual edges again. Only need to consider dirty edges since it makes sure that the new
// set of connections is a super set of the old
for (int i = 0; i < dirtyVertexes.size(); i++) {
dirtyVertexes.get(i).pruneNonMutal(EdgeType.CONNECTION);
dirtyVertexes.get(i).marked = false;
}
// Final clean up to return just valid grids
disconnectInvalidVertices();
// Name says it all
convertToOutput(corners);
}
|
class class_name[name] begin[{]
method[process, return_type[void], modifier[public], parameter[corners]] begin[{]
assign[THIS[member[None.corners]], member[.corners]]
call[vertexes.reset, parameter[]]
call[edges.reset, parameter[]]
call[clusters.reset, parameter[]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=grow, postfix_operators=[], prefix_operators=[], qualifier=vertexes, selectors=[], type_arguments=None), name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vertex, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[]), type==, value=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=corners, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=idx, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[nn.setPoints, parameter[member[.corners], literal[true]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=vertexes, selectors=[], type_arguments=None), MemberReference(member=corners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findVertexNeighbors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=corners, 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[.handleAmbiguousVertexes, parameter[member[.corners]]]
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=vertexes, selectors=[], type_arguments=None), name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vertex, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=PARALLEL, postfix_operators=[], prefix_operators=[], qualifier=EdgeType, selectors=[])], member=pruneNonMutal, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=PERPENDICULAR, postfix_operators=[], prefix_operators=[], qualifier=EdgeType, selectors=[])], member=pruneNonMutal, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=vertexes, 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)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=vertexes, selectors=[], type_arguments=None)], member=selectConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=vertexes, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=idx, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[dirtyVertexes.clear, 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=vertexes, selectors=[], type_arguments=None), name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vertex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=v.connections, selectors=[], type_arguments=None), name=before)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CONNECTION, postfix_operators=[], prefix_operators=[], qualifier=EdgeType, selectors=[])], member=pruneNonMutal, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=before, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=v.connections, selectors=[], type_arguments=None), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=dirtyVertexes, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=marked, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=vertexes, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[.repairVertexes, parameter[]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=dirtyVertexes, selectors=[MethodInvocation(arguments=[MemberReference(member=CONNECTION, postfix_operators=[], prefix_operators=[], qualifier=EdgeType, selectors=[])], member=pruneNonMutal, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=dirtyVertexes, selectors=[MemberReference(member=marked, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=dirtyVertexes, 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[.disconnectInvalidVertices, parameter[]]
call[.convertToOutput, parameter[member[.corners]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[process] operator[SEP] identifier[List] operator[<] identifier[ChessboardCorner] operator[>] identifier[corners] operator[SEP] {
Keyword[this] operator[SEP] identifier[corners] operator[=] identifier[corners] operator[SEP] identifier[vertexes] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[edges] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[clusters] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[idx] operator[=] Other[0] operator[SEP] identifier[idx] operator[<] identifier[corners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[idx] operator[++] operator[SEP] {
identifier[Vertex] identifier[v] operator[=] identifier[vertexes] operator[SEP] identifier[grow] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[index] operator[=] identifier[idx] operator[SEP]
}
identifier[nn] operator[SEP] identifier[setPoints] operator[SEP] identifier[corners] , literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[corners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[findVertexNeighbors] operator[SEP] identifier[vertexes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[corners] operator[SEP] operator[SEP]
}
identifier[handleAmbiguousVertexes] operator[SEP] identifier[corners] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[vertexes] operator[SEP] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Vertex] identifier[v] operator[=] identifier[vertexes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[pruneNonMutal] operator[SEP] identifier[EdgeType] operator[SEP] identifier[PARALLEL] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[pruneNonMutal] operator[SEP] identifier[EdgeType] operator[SEP] identifier[PERPENDICULAR] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[idx] operator[=] Other[0] operator[SEP] identifier[idx] operator[<] identifier[vertexes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[idx] operator[++] operator[SEP] {
identifier[selectConnections] operator[SEP] identifier[vertexes] operator[SEP] identifier[get] operator[SEP] identifier[idx] operator[SEP] operator[SEP] operator[SEP]
}
identifier[dirtyVertexes] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[vertexes] operator[SEP] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Vertex] identifier[v] operator[=] identifier[vertexes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[before] operator[=] identifier[v] operator[SEP] identifier[connections] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[pruneNonMutal] operator[SEP] identifier[EdgeType] operator[SEP] identifier[CONNECTION] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[before] operator[!=] identifier[v] operator[SEP] identifier[connections] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
identifier[dirtyVertexes] operator[SEP] identifier[add] operator[SEP] identifier[v] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[marked] operator[=] literal[boolean] operator[SEP]
}
}
identifier[repairVertexes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dirtyVertexes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[dirtyVertexes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[pruneNonMutal] operator[SEP] identifier[EdgeType] operator[SEP] identifier[CONNECTION] operator[SEP] operator[SEP] identifier[dirtyVertexes] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[marked] operator[=] literal[boolean] operator[SEP]
}
identifier[disconnectInvalidVertices] operator[SEP] operator[SEP] operator[SEP] identifier[convertToOutput] operator[SEP] identifier[corners] operator[SEP] operator[SEP]
}
|
@Synchronized
@SneakyThrows
public void buildMetadataResolverAggregate(final String entityId) {
LOGGER.trace("Building metadata resolver aggregate");
this.metadataResolver = new ChainingMetadataResolver();
val resolvers = new ArrayList<MetadataResolver>();
val entries = this.metadataResources.entrySet();
entries.forEach(entry -> {
val resource = entry.getKey();
LOGGER.debug("Loading [{}]", resource.getFilename());
resolvers.addAll(loadMetadataFromResource(entry.getValue(), resource, entityId));
});
this.metadataResolver.setId(ChainingMetadataResolver.class.getCanonicalName());
this.metadataResolver.setResolvers(resolvers);
LOGGER.debug("Collected metadata from [{}] resolvers(s). Initializing aggregate resolver...", resolvers.size());
this.metadataResolver.initialize();
LOGGER.info("Metadata aggregate initialized successfully.");
}
|
class class_name[name] begin[{]
method[buildMetadataResolverAggregate, return_type[void], modifier[public], parameter[entityId]] begin[{]
call[LOGGER.trace, parameter[literal["Building metadata resolver aggregate"]]]
assign[THIS[member[None.metadataResolver]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChainingMetadataResolver, sub_type=None))]
local_variable[type[val], resolvers]
local_variable[type[val], entries]
call[entries.forEach, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=resource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Loading [{}]"), MethodInvocation(arguments=[], member=getFilename, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=entityId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadMetadataFromResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=resolvers, selectors=[], type_arguments=None), label=None)], parameters=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
THIS[member[None.metadataResolver]call[None.setId, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ChainingMetadataResolver, sub_type=None))]]]
THIS[member[None.metadataResolver]call[None.setResolvers, parameter[member[.resolvers]]]]
call[LOGGER.debug, parameter[literal["Collected metadata from [{}] resolvers(s). Initializing aggregate resolver..."], call[resolvers.size, parameter[]]]]
THIS[member[None.metadataResolver]call[None.initialize, parameter[]]]
call[LOGGER.info, parameter[literal["Metadata aggregate initialized successfully."]]]
end[}]
END[}]
|
annotation[@] identifier[Synchronized] annotation[@] identifier[SneakyThrows] Keyword[public] Keyword[void] identifier[buildMetadataResolverAggregate] operator[SEP] Keyword[final] identifier[String] identifier[entityId] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[metadataResolver] operator[=] Keyword[new] identifier[ChainingMetadataResolver] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[resolvers] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[MetadataResolver] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[entries] operator[=] Keyword[this] operator[SEP] identifier[metadataResources] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[entries] operator[SEP] identifier[forEach] operator[SEP] identifier[entry] operator[->] {
identifier[val] identifier[resource] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[resource] operator[SEP] identifier[getFilename] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resolvers] operator[SEP] identifier[addAll] operator[SEP] identifier[loadMetadataFromResource] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[resource] , identifier[entityId] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[metadataResolver] operator[SEP] identifier[setId] operator[SEP] identifier[ChainingMetadataResolver] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[metadataResolver] operator[SEP] identifier[setResolvers] operator[SEP] identifier[resolvers] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[resolvers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[metadataResolver] operator[SEP] identifier[initialize] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public Observable<ServiceResponse<Page<VirtualNetworkUsageInner>>> listUsageWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) {
return listUsageSinglePageAsync(resourceGroupName, virtualNetworkName)
.concatMap(new Func1<ServiceResponse<Page<VirtualNetworkUsageInner>>, Observable<ServiceResponse<Page<VirtualNetworkUsageInner>>>>() {
@Override
public Observable<ServiceResponse<Page<VirtualNetworkUsageInner>>> call(ServiceResponse<Page<VirtualNetworkUsageInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listUsageNextWithServiceResponseAsync(nextPageLink));
}
});
}
|
class class_name[name] begin[{]
method[listUsageWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, virtualNetworkName]] begin[{]
return[call[.listUsageSinglePageAsync, parameter[member[.resourceGroupName], member[.virtualNetworkName]]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[VirtualNetworkUsageInner] operator[>] operator[>] operator[>] identifier[listUsageWithServiceResponseAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[String] identifier[virtualNetworkName] operator[SEP] {
Keyword[return] identifier[listUsageSinglePageAsync] operator[SEP] identifier[resourceGroupName] , identifier[virtualNetworkName] operator[SEP] operator[SEP] identifier[concatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[VirtualNetworkUsageInner] operator[>] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[VirtualNetworkUsageInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[VirtualNetworkUsageInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[VirtualNetworkUsageInner] operator[>] operator[>] identifier[page] operator[SEP] {
identifier[String] identifier[nextPageLink] operator[=] identifier[page] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextPageLink] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP] identifier[concatWith] operator[SEP] identifier[listUsageNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
@Override
public List<T> multiGet(List<List<Object>> keys)
{
// keysにはStateBaseNameの名称のみが指定される。そのため、1要素目を用いればいい。
String baseKey = (String) keys.get(0).get(0);
// 前回のクラスタ実行結果を取得する。存在しない場合は空値として扱う。
List<T> dataModels = new ArrayList<>();
T dataModel = null;
Long previousTxId = null;
if (this.previousSaveTxId == null)
{
// クエリによってtxIdが存在しない状態で本メソッドが呼ばれる可能性があるため、nullの場合は補正を行う。
if (this.txId == null)
{
previousTxId = 0L;
}
else
{
previousTxId = this.txId - 1;
}
}
else
{
previousTxId = this.previousSaveTxId;
}
try
{
dataModel = getState(baseKey, previousTxId, this.partitionIndex, true);
}
catch (IOException ex)
{
logger.warn("State get failed. BaseKey=" + baseKey + " ,txId=" + previousTxId
+ " ,partitionIndex=" + this.partitionIndex, ex);
}
// 取得できなかった場合は空リストを返す
if (dataModel == null)
{
return dataModels;
}
// 前回実行結果が存在し、前回の状態マージから一定時刻が経過していた場合、他のパーティションとのマージ処理を実行
if (isExecuteMerge() == true)
{
for (int nowIndex = 0; nowIndex < this.numPartitions; nowIndex++)
{
// 自分と同じインデックスの場合は省略
if (nowIndex == this.partitionIndex)
{
continue;
}
T otherDataSet = null;
try
{
otherDataSet = getState(baseKey, this.previousSaveTxId, nowIndex, false);
}
catch (IOException ex)
{
logger.warn("MergeTargetState get failed. BaseKey=" + baseKey + " ,txId="
+ previousTxId + " ,partitionIndex=" + nowIndex, ex);
}
// 前回の他パーティションの結果が存在した場合、順次マージを行う
if (otherDataSet != null)
{
dataModel = mergeState(dataModel, otherDataSet, this.mergeConfig);
// マージ実行メッセージを出力
if (logger.isDebugEnabled() == true)
{
logger.debug("Merge Executed. PartitionIndex=" + this.partitionIndex
+ ", MergeTransactionId=" + previousTxId);
}
}
}
this.previousMergeTime = getCurrentTime();
}
dataModels.add(dataModel);
return dataModels;
}
|
class class_name[name] begin[{]
method[multiGet, return_type[type[List]], modifier[public], parameter[keys]] begin[{]
local_variable[type[String], baseKey]
local_variable[type[List], dataModels]
local_variable[type[T], dataModel]
local_variable[type[Long], previousTxId]
if[binary_operation[THIS[member[None.previousSaveTxId]], ==, literal[null]]] begin[{]
if[binary_operation[THIS[member[None.txId]], ==, literal[null]]] begin[{]
assign[member[.previousTxId], literal[0L]]
else begin[{]
assign[member[.previousTxId], binary_operation[THIS[member[None.txId]], -, literal[1]]]
end[}]
else begin[{]
assign[member[.previousTxId], THIS[member[None.previousSaveTxId]]]
end[}]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dataModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=baseKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=previousTxId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=partitionIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="State get failed. BaseKey="), operandr=MemberReference(member=baseKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ,txId="), operator=+), operandr=MemberReference(member=previousTxId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ,partitionIndex="), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=partitionIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None)
if[binary_operation[member[.dataModel], ==, literal[null]]] begin[{]
return[member[.dataModels]]
else begin[{]
None
end[}]
if[binary_operation[call[.isExecuteMerge, parameter[]], ==, literal[true]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=partitionIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=otherDataSet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=otherDataSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=baseKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=previousSaveTxId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=nowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MergeTargetState get failed. BaseKey="), operandr=MemberReference(member=baseKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ,txId="), operator=+), operandr=MemberReference(member=previousTxId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ,partitionIndex="), operator=+), operandr=MemberReference(member=nowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=otherDataSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dataModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dataModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=otherDataSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mergeConfig, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=mergeState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Merge Executed. PartitionIndex="), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=partitionIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", MergeTransactionId="), operator=+), operandr=MemberReference(member=previousTxId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=nowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=numPartitions, 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=nowIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=nowIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[THIS[member[None.previousMergeTime]], call[.getCurrentTime, parameter[]]]
else begin[{]
None
end[}]
call[dataModels.add, parameter[member[.dataModel]]]
return[member[.dataModels]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[T] operator[>] identifier[multiGet] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[Object] operator[>] operator[>] identifier[keys] operator[SEP] {
identifier[String] identifier[baseKey] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[keys] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[dataModels] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[T] identifier[dataModel] operator[=] Other[null] operator[SEP] identifier[Long] identifier[previousTxId] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[previousSaveTxId] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[txId] operator[==] Other[null] operator[SEP] {
identifier[previousTxId] operator[=] Other[0L] operator[SEP]
}
Keyword[else] {
identifier[previousTxId] operator[=] Keyword[this] operator[SEP] identifier[txId] operator[-] Other[1] operator[SEP]
}
}
Keyword[else] {
identifier[previousTxId] operator[=] Keyword[this] operator[SEP] identifier[previousSaveTxId] operator[SEP]
}
Keyword[try] {
identifier[dataModel] operator[=] identifier[getState] operator[SEP] identifier[baseKey] , identifier[previousTxId] , Keyword[this] operator[SEP] identifier[partitionIndex] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[baseKey] operator[+] literal[String] operator[+] identifier[previousTxId] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[partitionIndex] , identifier[ex] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[dataModel] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[dataModels] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isExecuteMerge] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[nowIndex] operator[=] Other[0] operator[SEP] identifier[nowIndex] operator[<] Keyword[this] operator[SEP] identifier[numPartitions] operator[SEP] identifier[nowIndex] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[nowIndex] operator[==] Keyword[this] operator[SEP] identifier[partitionIndex] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[T] identifier[otherDataSet] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[otherDataSet] operator[=] identifier[getState] operator[SEP] identifier[baseKey] , Keyword[this] operator[SEP] identifier[previousSaveTxId] , identifier[nowIndex] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[baseKey] operator[+] literal[String] operator[+] identifier[previousTxId] operator[+] literal[String] operator[+] identifier[nowIndex] , identifier[ex] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[otherDataSet] operator[!=] Other[null] operator[SEP] {
identifier[dataModel] operator[=] identifier[mergeState] operator[SEP] identifier[dataModel] , identifier[otherDataSet] , Keyword[this] operator[SEP] identifier[mergeConfig] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[partitionIndex] operator[+] literal[String] operator[+] identifier[previousTxId] operator[SEP] operator[SEP]
}
}
}
Keyword[this] operator[SEP] identifier[previousMergeTime] operator[=] identifier[getCurrentTime] operator[SEP] operator[SEP] operator[SEP]
}
identifier[dataModels] operator[SEP] identifier[add] operator[SEP] identifier[dataModel] operator[SEP] operator[SEP] Keyword[return] identifier[dataModels] operator[SEP]
}
|
public ServiceFuture<FailoverGroupInner> beginForceFailoverAllowDataLossAsync(String resourceGroupName, String serverName, String failoverGroupName, final ServiceCallback<FailoverGroupInner> serviceCallback) {
return ServiceFuture.fromResponse(beginForceFailoverAllowDataLossWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName), serviceCallback);
}
|
class class_name[name] begin[{]
method[beginForceFailoverAllowDataLossAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, serverName, failoverGroupName, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.beginForceFailoverAllowDataLossWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName], member[.failoverGroupName]]], member[.serviceCallback]]]]
end[}]
END[}]
|
Keyword[public] identifier[ServiceFuture] operator[<] identifier[FailoverGroupInner] operator[>] identifier[beginForceFailoverAllowDataLossAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[String] identifier[failoverGroupName] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[FailoverGroupInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[beginForceFailoverAllowDataLossWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[failoverGroupName] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public boolean checkIfEJBWorkAllowed(EJBModuleMetaDataImpl module) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
// F743-15941 - By default, this flag will be false for compatibility.
// For performance, this flag will be reset after the application is
// fully started, so we use double-checked locking with a volatile.
// For late add modules, this flag will be reset back to true by the
// starting thread before any beans from that module are exposed.
if (!ivCurrentlyBlockingWork) {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "checkIfEJBWorkAllowed: " + module.getJ2EEName() + ": not blocking work");
return true;
}
EJBModuleMetaDataImpl moduleBeingAddedLate;
synchronized (this) {
if (!ivCurrentlyBlockingWork) {
// The application has fully started, so allow this and all future
// work requests.
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "checkIfEJBWorkAllowed: " + module.getJ2EEName() + ": not blocking work");
return true;
}
if (ivStartupThread == Thread.currentThread()) {
// The application is in the process of being started, and the
// caller is the startup thread. Allow this work request only
// until the application is fully started.
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "checkIfEJBWorkAllowed: " + module.getJ2EEName() + ": allowing startup thread");
return false;
}
moduleBeingAddedLate = ivModuleBeingAddedLate;
if (moduleBeingAddedLate != null && moduleBeingAddedLate != module) {
// startupThread is not null and ivModuleBeingAddedLate is not
// null, which means a module is being added to a started
// application. Since the work request is for a module that is
// already part of the started application, allow this and all
// future work requests.
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "checkIfEJBWorkAllowed: " + module.getJ2EEName() + ": allowing non-late-add module");
return true;
}
// At this point, one of two scenarios is occurring:
// 1. The application is being started, but work has been requested on
// some thread other than the startup thread.
// 2. A module is being added to a started application, but work has
// been requested for that module on some thread other than the
// module startup thread.
//
// F743-15941 - In either case, wait for the application or module to
// finish starting either successfully or unsuccessfully.
long begin = System.nanoTime();
long end = begin + TimeUnit.MILLISECONDS.toNanos(ContainerProperties.BlockWorkUntilAppStartedWaitTime);
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "checkIfEJBWorkAllowed: " + module.getJ2EEName() + ": waiting for application to start");
// Continue waiting for either the application or module to finish
// starting. If we were waiting for a late-add module (i.e.,
// moduleBeingAddedLate != null), then stop waiting if a different
// module is now being started.
while (ivCurrentlyBlockingWork && (moduleBeingAddedLate == null || moduleBeingAddedLate == ivModuleBeingAddedLate)) {
try {
long waitTime = end - System.nanoTime();
if (waitTime <= 0) {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "checkIfEJBWorkAllowed: wait timed out");
// The application or module did not finish starting
// in the allotted time. Note that this will occur if
// the startup thread (e.g., servlet context listener,
// singleton startup, or legacy startup bean) attempted
// to wait for asynchronous work (e.g., fire-and-return
// async, MDB, timer) to be delivered to itself.
if (moduleBeingAddedLate != null) {
throw new ApplicationNotStartedException("module " + module.getName() + " in application " + ivName
+ " has not finished startup processing");
}
throw new ApplicationNotStartedException("application " + ivName + " has not finished startup processing");
}
// Wait until notified by unblockThreadsWaitingForStart.
TimeUnit.NANOSECONDS.timedWait(this, waitTime);
} catch (InterruptedException ex) {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "checkIfEJBWorkAllowed: wait interrupted");
FFDCFilter.processException(ex, CLASS_NAME + ".checkIfEJBWorkAllowed", "360", this);
Thread.currentThread().interrupt();
}
}
}
// The application or module is no longer starting, but now we need
// to check whether the start was successful.
// EJBModuleMetaDataImpl.ivStopping isn't volatile, but the startup
// thread will also synchronize on this object via cleanUp.
if (moduleBeingAddedLate != null && moduleBeingAddedLate.ivStopping) {
// The late-add module failed to start.
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "checkIfEJBWorkAllowed: module failed to start");
throw new EJBStoppedException("module " + module.getName() + " in application " + ivName + " failed to start");
}
if (ivStopping) {
// The application failed to start.
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "checkIfEJBWorkAllowed: application failed to start");
throw new EJBStoppedException("application " + ivName + " failed to start");
}
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "checkIfEJBWorkAllowed: application started");
return true;
}
|
class class_name[name] begin[{]
method[checkIfEJBWorkAllowed, return_type[type[boolean]], modifier[public], parameter[module]] begin[{]
local_variable[type[boolean], isTraceOn]
if[member[.ivCurrentlyBlockingWork]] begin[{]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[literal["checkIfEJBWorkAllowed: "], +, call[module.getJ2EEName, parameter[]]], +, literal[": not blocking work"]]]]
else begin[{]
None
end[}]
return[literal[true]]
else begin[{]
None
end[}]
local_variable[type[EJBModuleMetaDataImpl], moduleBeingAddedLate]
SYNCHRONIZED[THIS[]] BEGIN[{]
if[member[.ivCurrentlyBlockingWork]] begin[{]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[literal["checkIfEJBWorkAllowed: "], +, call[module.getJ2EEName, parameter[]]], +, literal[": not blocking work"]]]]
else begin[{]
None
end[}]
return[literal[true]]
else begin[{]
None
end[}]
if[binary_operation[member[.ivStartupThread], ==, call[Thread.currentThread, parameter[]]]] begin[{]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[literal["checkIfEJBWorkAllowed: "], +, call[module.getJ2EEName, parameter[]]], +, literal[": allowing startup thread"]]]]
else begin[{]
None
end[}]
return[literal[false]]
else begin[{]
None
end[}]
assign[member[.moduleBeingAddedLate], member[.ivModuleBeingAddedLate]]
if[binary_operation[binary_operation[member[.moduleBeingAddedLate], !=, literal[null]], &&, binary_operation[member[.moduleBeingAddedLate], !=, member[.module]]]] begin[{]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[literal["checkIfEJBWorkAllowed: "], +, call[module.getJ2EEName, parameter[]]], +, literal[": allowing non-late-add module"]]]]
else begin[{]
None
end[}]
return[literal[true]]
else begin[{]
None
end[}]
local_variable[type[long], begin]
local_variable[type[long], end]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[literal["checkIfEJBWorkAllowed: "], +, call[module.getJ2EEName, parameter[]]], +, literal[": waiting for application to start"]]]]
else begin[{]
None
end[}]
while[binary_operation[member[.ivCurrentlyBlockingWork], &&, binary_operation[binary_operation[member[.moduleBeingAddedLate], ==, literal[null]], ||, binary_operation[member[.moduleBeingAddedLate], ==, member[.ivModuleBeingAddedLate]]]]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=nanoTime, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operator=-), name=waitTime)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=waitTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="checkIfEJBWorkAllowed: wait timed out")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=moduleBeingAddedLate, 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=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="module "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=module, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" in application "), operator=+), operandr=MemberReference(member=ivName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has not finished startup processing"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ApplicationNotStartedException, sub_type=None)), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="application "), operandr=MemberReference(member=ivName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has not finished startup processing"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ApplicationNotStartedException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=waitTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=timedWait, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit.NANOSECONDS, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="checkIfEJBWorkAllowed: wait interrupted")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".checkIfEJBWorkAllowed"), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="360"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
if[binary_operation[binary_operation[member[.moduleBeingAddedLate], !=, literal[null]], &&, member[moduleBeingAddedLate.ivStopping]]] begin[{]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], literal["checkIfEJBWorkAllowed: module failed to start"]]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="module "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=module, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" in application "), operator=+), operandr=MemberReference(member=ivName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" failed to start"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EJBStoppedException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[member[.ivStopping]] begin[{]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], literal["checkIfEJBWorkAllowed: application failed to start"]]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="application "), operandr=MemberReference(member=ivName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" failed to start"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EJBStoppedException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], literal["checkIfEJBWorkAllowed: application started"]]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[checkIfEJBWorkAllowed] operator[SEP] identifier[EJBModuleMetaDataImpl] identifier[module] operator[SEP] {
Keyword[final] Keyword[boolean] identifier[isTraceOn] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ivCurrentlyBlockingWork] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[module] operator[SEP] identifier[getJ2EEName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
identifier[EJBModuleMetaDataImpl] identifier[moduleBeingAddedLate] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[ivCurrentlyBlockingWork] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[module] operator[SEP] identifier[getJ2EEName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ivStartupThread] operator[==] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[module] operator[SEP] identifier[getJ2EEName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
identifier[moduleBeingAddedLate] operator[=] identifier[ivModuleBeingAddedLate] operator[SEP] Keyword[if] operator[SEP] identifier[moduleBeingAddedLate] operator[!=] Other[null] operator[&&] identifier[moduleBeingAddedLate] operator[!=] identifier[module] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[module] operator[SEP] identifier[getJ2EEName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[long] identifier[begin] operator[=] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[end] operator[=] identifier[begin] operator[+] identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] identifier[toNanos] operator[SEP] identifier[ContainerProperties] operator[SEP] identifier[BlockWorkUntilAppStartedWaitTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[module] operator[SEP] identifier[getJ2EEName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[ivCurrentlyBlockingWork] operator[&&] operator[SEP] identifier[moduleBeingAddedLate] operator[==] Other[null] operator[||] identifier[moduleBeingAddedLate] operator[==] identifier[ivModuleBeingAddedLate] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[long] identifier[waitTime] operator[=] identifier[end] operator[-] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[waitTime] operator[<=] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[moduleBeingAddedLate] operator[!=] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ApplicationNotStartedException] operator[SEP] literal[String] operator[+] identifier[module] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[ivName] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[ApplicationNotStartedException] operator[SEP] literal[String] operator[+] identifier[ivName] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[TimeUnit] operator[SEP] identifier[NANOSECONDS] operator[SEP] identifier[timedWait] operator[SEP] Keyword[this] , identifier[waitTime] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ex] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[ex] , identifier[CLASS_NAME] operator[+] literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[moduleBeingAddedLate] operator[!=] Other[null] operator[&&] identifier[moduleBeingAddedLate] operator[SEP] identifier[ivStopping] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[EJBStoppedException] operator[SEP] literal[String] operator[+] identifier[module] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[ivName] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ivStopping] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[EJBStoppedException] operator[SEP] literal[String] operator[+] identifier[ivName] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
protected I_CmsXmlContentValue addValue(
CmsObject cms,
Element parent,
I_CmsXmlSchemaType type,
Locale locale,
int insertIndex) {
// first generate the XML element for the new value
Element element = type.generateXml(cms, this, parent, locale);
// detach the XML element from the appended position in order to insert it at the required position
element.detach();
// add the XML element at the required position in the parent XML node
CmsXmlGenericWrapper.content(parent).add(insertIndex, element);
// create the type and return it
I_CmsXmlContentValue value = type.createValue(this, element, locale);
// generate the default value again - required for nested mappings because only now the full path is available
String defaultValue = m_contentDefinition.getContentHandler().getDefault(cms, value, locale);
if (defaultValue != null) {
// only if there is a default value available use it to overwrite the initial default
value.setStringValue(cms, defaultValue);
}
// finally return the value
return value;
}
|
class class_name[name] begin[{]
method[addValue, return_type[type[I_CmsXmlContentValue]], modifier[protected], parameter[cms, parent, type, locale, insertIndex]] begin[{]
local_variable[type[Element], element]
call[element.detach, parameter[]]
call[CmsXmlGenericWrapper.content, parameter[member[.parent]]]
local_variable[type[I_CmsXmlContentValue], value]
local_variable[type[String], defaultValue]
if[binary_operation[member[.defaultValue], !=, literal[null]]] begin[{]
call[value.setStringValue, parameter[member[.cms], member[.defaultValue]]]
else begin[{]
None
end[}]
return[member[.value]]
end[}]
END[}]
|
Keyword[protected] identifier[I_CmsXmlContentValue] identifier[addValue] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[Element] identifier[parent] , identifier[I_CmsXmlSchemaType] identifier[type] , identifier[Locale] identifier[locale] , Keyword[int] identifier[insertIndex] operator[SEP] {
identifier[Element] identifier[element] operator[=] identifier[type] operator[SEP] identifier[generateXml] operator[SEP] identifier[cms] , Keyword[this] , identifier[parent] , identifier[locale] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[detach] operator[SEP] operator[SEP] operator[SEP] identifier[CmsXmlGenericWrapper] operator[SEP] identifier[content] operator[SEP] identifier[parent] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[insertIndex] , identifier[element] operator[SEP] operator[SEP] identifier[I_CmsXmlContentValue] identifier[value] operator[=] identifier[type] operator[SEP] identifier[createValue] operator[SEP] Keyword[this] , identifier[element] , identifier[locale] operator[SEP] operator[SEP] identifier[String] identifier[defaultValue] operator[=] identifier[m_contentDefinition] operator[SEP] identifier[getContentHandler] operator[SEP] operator[SEP] operator[SEP] identifier[getDefault] operator[SEP] identifier[cms] , identifier[value] , identifier[locale] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[defaultValue] operator[!=] Other[null] operator[SEP] {
identifier[value] operator[SEP] identifier[setStringValue] operator[SEP] identifier[cms] , identifier[defaultValue] operator[SEP] operator[SEP]
}
Keyword[return] identifier[value] operator[SEP]
}
|
private String collapseWhitespaces(String src)
{
StringBuffer ret = new StringBuffer();
boolean inws = false;
for (int i = 0; i < src.length(); i++)
{
char ch = src.charAt(i);
if (collapsews && isWhitespace(ch))
{
if (!inws)
{
ret.append(' ');
inws = true;
}
}
else if (isLineBreak(ch))
{
ret.append('\r'); //represent all line breaks as LF
//reduce eventual CR+LF to CR only
if (ch == '\r' && i+1 < src.length() && src.charAt(i+1) == '\n')
i++;
}
else
{
inws = false;
ret.append(ch);
}
}
return new String(ret);
}
|
class class_name[name] begin[{]
method[collapseWhitespaces, return_type[type[String]], modifier[private], parameter[src]] begin[{]
local_variable[type[StringBuffer], ret]
local_variable[type[boolean], inws]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), name=ch)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=collapsews, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLineBreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=inws, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r')], member=append, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r'), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), operator=<), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n'), operator===), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=inws, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=append, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=inws, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[ClassCreator(arguments=[MemberReference(member=ret, 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=String, sub_type=None))]
end[}]
END[}]
|
Keyword[private] identifier[String] identifier[collapseWhitespaces] operator[SEP] identifier[String] identifier[src] operator[SEP] {
identifier[StringBuffer] identifier[ret] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[inws] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[src] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[char] identifier[ch] operator[=] identifier[src] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[collapsews] operator[&&] identifier[isWhitespace] operator[SEP] identifier[ch] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[inws] operator[SEP] {
identifier[ret] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[inws] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[isLineBreak] operator[SEP] identifier[ch] operator[SEP] operator[SEP] {
identifier[ret] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[&&] identifier[i] operator[+] Other[1] operator[<] identifier[src] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[&&] identifier[src] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] identifier[i] operator[++] operator[SEP]
}
Keyword[else] {
identifier[inws] operator[=] literal[boolean] operator[SEP] identifier[ret] operator[SEP] identifier[append] operator[SEP] identifier[ch] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[ret] operator[SEP] operator[SEP]
}
|
public static EvaluationStrategy<Long, Long> instantiateStrategy(final Properties properties, final DataModelIF<Long, Long> trainingModel, final DataModelIF<Long, Long> testModel)
throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException {
Double threshold = Double.parseDouble(properties.getProperty(RELEVANCE_THRESHOLD));
String strategyClassName = properties.getProperty(STRATEGY);
Class<?> strategyClass = Class.forName(strategyClassName);
// get strategy
EvaluationStrategy<Long, Long> strategy = null;
if (strategyClassName.contains("RelPlusN")) {
Integer number = Integer.parseInt(properties.getProperty(RELPLUSN_N));
Long seed = Long.parseLong(properties.getProperty(RELPLUSN_SEED));
strategy = new RelPlusN(trainingModel, testModel, number, threshold, seed);
} else {
Object strategyObj = strategyClass.getConstructor(DataModelIF.class, DataModelIF.class, double.class).newInstance(trainingModel, testModel, threshold);
if (strategyObj instanceof EvaluationStrategy) {
@SuppressWarnings("unchecked")
EvaluationStrategy<Long, Long> strategyTemp = (EvaluationStrategy<Long, Long>) strategyObj;
strategy = strategyTemp;
}
}
return strategy;
}
|
class class_name[name] begin[{]
method[instantiateStrategy, return_type[type[EvaluationStrategy]], modifier[public static], parameter[properties, trainingModel, testModel]] begin[{]
local_variable[type[Double], threshold]
local_variable[type[String], strategyClassName]
local_variable[type[Class], strategyClass]
local_variable[type[EvaluationStrategy], strategy]
if[call[strategyClassName.contains, parameter[literal["RelPlusN"]]]] begin[{]
local_variable[type[Integer], number]
local_variable[type[Long], seed]
assign[member[.strategy], ClassCreator(arguments=[MemberReference(member=trainingModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=testModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=threshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=seed, 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=RelPlusN, sub_type=None))]
else begin[{]
local_variable[type[Object], strategyObj]
if[binary_operation[member[.strategyObj], instanceof, type[EvaluationStrategy]]] begin[{]
local_variable[type[EvaluationStrategy], strategyTemp]
assign[member[.strategy], member[.strategyTemp]]
else begin[{]
None
end[}]
end[}]
return[member[.strategy]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[EvaluationStrategy] operator[<] identifier[Long] , identifier[Long] operator[>] identifier[instantiateStrategy] operator[SEP] Keyword[final] identifier[Properties] identifier[properties] , Keyword[final] identifier[DataModelIF] operator[<] identifier[Long] , identifier[Long] operator[>] identifier[trainingModel] , Keyword[final] identifier[DataModelIF] operator[<] identifier[Long] , identifier[Long] operator[>] identifier[testModel] operator[SEP] Keyword[throws] identifier[ClassNotFoundException] , identifier[IllegalAccessException] , identifier[InstantiationException] , identifier[InvocationTargetException] , identifier[NoSuchMethodException] {
identifier[Double] identifier[threshold] operator[=] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RELEVANCE_THRESHOLD] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[strategyClassName] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[STRATEGY] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[strategyClass] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[strategyClassName] operator[SEP] operator[SEP] identifier[EvaluationStrategy] operator[<] identifier[Long] , identifier[Long] operator[>] identifier[strategy] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[strategyClassName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[Integer] identifier[number] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RELPLUSN_N] operator[SEP] operator[SEP] operator[SEP] identifier[Long] identifier[seed] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RELPLUSN_SEED] operator[SEP] operator[SEP] operator[SEP] identifier[strategy] operator[=] Keyword[new] identifier[RelPlusN] operator[SEP] identifier[trainingModel] , identifier[testModel] , identifier[number] , identifier[threshold] , identifier[seed] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Object] identifier[strategyObj] operator[=] identifier[strategyClass] operator[SEP] identifier[getConstructor] operator[SEP] identifier[DataModelIF] operator[SEP] Keyword[class] , identifier[DataModelIF] operator[SEP] Keyword[class] , Keyword[double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[trainingModel] , identifier[testModel] , identifier[threshold] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strategyObj] Keyword[instanceof] identifier[EvaluationStrategy] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[EvaluationStrategy] operator[<] identifier[Long] , identifier[Long] operator[>] identifier[strategyTemp] operator[=] operator[SEP] identifier[EvaluationStrategy] operator[<] identifier[Long] , identifier[Long] operator[>] operator[SEP] identifier[strategyObj] operator[SEP] identifier[strategy] operator[=] identifier[strategyTemp] operator[SEP]
}
}
Keyword[return] identifier[strategy] operator[SEP]
}
|
public Object[] getArguments(Type[] formalParameters) {
if (formalParameters.length == 0) {
return new Object[0];
}
Object[] arguments = new Object[formalParameters.length];
if (isObject(formalParameters)) {
// if there is single formal parameter and it is not a value type create object instance and initialize fields from
// request parameters; object class should have no arguments constructor
Class<?> type = (Class<?>) formalParameters[0];
Object object = Classes.newInstance(type);
for (Parameter parameter : parameters) {
Field field = Classes.getField(type, Strings.toMemberName(parameter.getName()));
Classes.setFieldValue(object, field, asObject(parameter.getValue(), field.getType()));
}
return new Object[] { object };
}
int i = 0, argumentsCount = Math.min(formalParameters.length, parameters.size());
for (i = 0; i < argumentsCount; ++i) {
arguments[i] = asObject(parameters.get(i).getValue(), formalParameters[i]);
}
for (; i < formalParameters.length; ++i) {
log.debug("Missing request parameter |%s|. Set it to null.", i, formalParameters[i]);
arguments[i] = null;
}
for (; i < parameters.size(); ++i) {
log.debug("Unused request parameter |%s|. Ignore it.", parameters.get(i));
}
return arguments;
}
|
class class_name[name] begin[{]
method[getArguments, return_type[type[Object]], modifier[public], parameter[formalParameters]] begin[{]
if[binary_operation[member[formalParameters.length], ==, literal[0]]] begin[{]
return[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[Object], arguments]
if[call[.isObject, parameter[member[.formalParameters]]]] begin[{]
local_variable[type[Class], type]
local_variable[type[Object], object]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None)], member=toMemberName, postfix_operators=[], prefix_operators=[], qualifier=Strings, selectors=[], type_arguments=None)], member=getField, postfix_operators=[], prefix_operators=[], qualifier=Classes, selectors=[], type_arguments=None), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=asObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setFieldValue, postfix_operators=[], prefix_operators=[], qualifier=Classes, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=parameter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Parameter, sub_type=None))), label=None)
return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[int], i]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=arguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=formalParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=asObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=argumentsCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing request parameter |%s|. Set it to null."), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=formalParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=arguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=formalParameters, selectors=[]), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unused request parameter |%s|. Ignore it."), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, 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=parameters, selectors=[], type_arguments=None), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
return[member[.arguments]]
end[}]
END[}]
|
Keyword[public] identifier[Object] operator[SEP] operator[SEP] identifier[getArguments] operator[SEP] identifier[Type] operator[SEP] operator[SEP] identifier[formalParameters] operator[SEP] {
Keyword[if] operator[SEP] identifier[formalParameters] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
Keyword[return] Keyword[new] identifier[Object] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
identifier[Object] operator[SEP] operator[SEP] identifier[arguments] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[formalParameters] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isObject] operator[SEP] identifier[formalParameters] operator[SEP] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[formalParameters] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Object] identifier[object] operator[=] identifier[Classes] operator[SEP] identifier[newInstance] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Parameter] identifier[parameter] operator[:] identifier[parameters] operator[SEP] {
identifier[Field] identifier[field] operator[=] identifier[Classes] operator[SEP] identifier[getField] operator[SEP] identifier[type] , identifier[Strings] operator[SEP] identifier[toMemberName] operator[SEP] identifier[parameter] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Classes] operator[SEP] identifier[setFieldValue] operator[SEP] identifier[object] , identifier[field] , identifier[asObject] operator[SEP] identifier[parameter] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[object]
} operator[SEP]
}
Keyword[int] identifier[i] operator[=] Other[0] , identifier[argumentsCount] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[formalParameters] operator[SEP] identifier[length] , identifier[parameters] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[argumentsCount] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[arguments] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[asObject] operator[SEP] identifier[parameters] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[formalParameters] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[formalParameters] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[i] , identifier[formalParameters] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[arguments] operator[SEP] identifier[i] operator[SEP] operator[=] Other[null] operator[SEP]
}
Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[parameters] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[parameters] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[arguments] operator[SEP]
}
|
protected static int installationOrder(Skill skill) {
final int len = StandardBuiltinCapacitiesProvider.SKILL_INSTALLATION_ORDER.length;
if (skill instanceof BuiltinSkill) {
for (int i = 0; i < len; ++i) {
final Class<? extends Skill> type = StandardBuiltinCapacitiesProvider.SKILL_INSTALLATION_ORDER[i];
if (type.isInstance(skill)) {
return i;
}
}
}
return len;
}
|
class class_name[name] begin[{]
method[installationOrder, return_type[type[int]], modifier[static protected], parameter[skill]] begin[{]
local_variable[type[int], len]
if[binary_operation[member[.skill], instanceof, type[BuiltinSkill]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=SKILL_INSTALLATION_ORDER, postfix_operators=[], prefix_operators=[], qualifier=StandardBuiltinCapacitiesProvider, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=type)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Skill, sub_type=None))], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=skill, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInstance, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
return[member[.len]]
end[}]
END[}]
|
Keyword[protected] Keyword[static] Keyword[int] identifier[installationOrder] operator[SEP] identifier[Skill] identifier[skill] operator[SEP] {
Keyword[final] Keyword[int] identifier[len] operator[=] identifier[StandardBuiltinCapacitiesProvider] operator[SEP] identifier[SKILL_INSTALLATION_ORDER] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[skill] Keyword[instanceof] identifier[BuiltinSkill] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] operator[++] identifier[i] operator[SEP] {
Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Skill] operator[>] identifier[type] operator[=] identifier[StandardBuiltinCapacitiesProvider] operator[SEP] identifier[SKILL_INSTALLATION_ORDER] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[isInstance] operator[SEP] identifier[skill] operator[SEP] operator[SEP] {
Keyword[return] identifier[i] operator[SEP]
}
}
}
Keyword[return] identifier[len] operator[SEP]
}
|
@CheckResult
@NonNull
public final Data<T> filter(@NonNull Predicate<? super T> predicate) {
return new FilterData<>(this, predicate);
}
|
class class_name[name] begin[{]
method[filter, return_type[type[Data]], modifier[final public], parameter[predicate]] begin[{]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=predicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=FilterData, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[CheckResult] annotation[@] identifier[NonNull] Keyword[public] Keyword[final] identifier[Data] operator[<] identifier[T] operator[>] identifier[filter] operator[SEP] annotation[@] identifier[NonNull] identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[predicate] operator[SEP] {
Keyword[return] Keyword[new] identifier[FilterData] operator[<] operator[>] operator[SEP] Keyword[this] , identifier[predicate] operator[SEP] operator[SEP]
}
|
public boolean evaluate(Object target) {
try {
return (Boolean) expression.evaluate(target);
}
catch (ClassCastException e) {
throw new IllegalArgumentException(
"Specified expression does not evaluate to a boolean value", e);
}
}
|
class class_name[name] begin[{]
method[evaluate, return_type[type[boolean]], modifier[public], parameter[target]] begin[{]
TryStatement(block=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=expression, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Specified expression does not evaluate to a boolean value"), 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=IllegalArgumentException, 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] Keyword[boolean] identifier[evaluate] operator[SEP] identifier[Object] identifier[target] operator[SEP] {
Keyword[try] {
Keyword[return] operator[SEP] identifier[Boolean] operator[SEP] identifier[expression] operator[SEP] identifier[evaluate] operator[SEP] identifier[target] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public Object fromStream(final byte[] iStream) throws IOException {
if (iStream == null || iStream.length == 0)
// NULL VALUE
return null;
final ByteArrayInputStream is = new ByteArrayInputStream(iStream);
final ObjectInputStream in = new ObjectInputStream(is);
try {
return in.readObject();
} catch (ClassNotFoundException e) {
throw new OSerializationException("Cannot unmarshall Java serialized object", e);
} finally {
in.close();
is.close();
}
}
|
class class_name[name] begin[{]
method[fromStream, return_type[type[Object]], modifier[public], parameter[iStream]] begin[{]
if[binary_operation[binary_operation[member[.iStream], ==, literal[null]], ||, binary_operation[member[iStream.length], ==, literal[0]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[ByteArrayInputStream], is]
local_variable[type[ObjectInputStream], in]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot unmarshall Java serialized object"), 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=OSerializationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}]
|
Keyword[public] identifier[Object] identifier[fromStream] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[iStream] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[iStream] operator[==] Other[null] operator[||] identifier[iStream] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[final] identifier[ByteArrayInputStream] identifier[is] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[iStream] operator[SEP] operator[SEP] Keyword[final] identifier[ObjectInputStream] identifier[in] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] identifier[is] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[in] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[OSerializationException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[is] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private static boolean isYunOS() {
try {
String version = System.getProperty("ro.yunos.version");
String vmName = System.getProperty("java.vm.name");
return (vmName != null && vmName.toLowerCase().contains("lemur"))
|| (version != null && version.trim().length() > 0);
} catch (Exception ignore) {
return false;
}
}
|
class class_name[name] begin[{]
method[isYunOS, return_type[type[boolean]], modifier[private static], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ro.yunos.version")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), name=version)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.vm.name")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), name=vmName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=vmName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=vmName, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="lemur")], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=version, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), operator=||), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
Keyword[private] Keyword[static] Keyword[boolean] identifier[isYunOS] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[String] identifier[version] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[vmName] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[vmName] operator[!=] Other[null] operator[&&] identifier[vmName] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[version] operator[!=] Other[null] operator[&&] identifier[version] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ignore] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
|
@Override
protected byte[] createTile(int z, long x, long y) {
byte[] bytes = null;
String zoomUrl = tileUrl;
// Replace x, y, and z
if (urlHasXYZ) {
long yRequest = y;
// If TMS, flip the y value
if (tileFormat == TileFormatType.TMS) {
yRequest = TileBoundingBoxUtils.getYAsOppositeTileFormat(z,
(int) y);
}
zoomUrl = replaceXYZ(zoomUrl, z, x, yRequest);
}
// Replace bounding box
if (urlHasBoundingBox) {
zoomUrl = replaceBoundingBox(zoomUrl, z, x, y);
}
URL url;
try {
url = new URL(zoomUrl);
} catch (MalformedURLException e) {
throw new GeoPackageException("Failed to download tile. URL: "
+ zoomUrl + ", z=" + z + ", x=" + x + ", y=" + y, e);
}
int attempt = 1;
while (true) {
try {
bytes = downloadTile(zoomUrl, url, z, x, y);
break;
} catch (Exception e) {
if (attempt < downloadAttempts) {
LOGGER.log(Level.WARNING,
"Failed to download tile after attempt " + attempt
+ " of " + downloadAttempts + ". URL: "
+ zoomUrl + ", z=" + z + ", x=" + x
+ ", y=" + y, e);
attempt++;
} else {
throw new GeoPackageException(
"Failed to download tile after " + downloadAttempts
+ " attempts. URL: " + zoomUrl + ", z=" + z
+ ", x=" + x + ", y=" + y, e);
}
}
}
return bytes;
}
|
class class_name[name] begin[{]
method[createTile, return_type[type[byte]], modifier[protected], parameter[z, x, y]] begin[{]
local_variable[type[byte], bytes]
local_variable[type[String], zoomUrl]
if[member[.urlHasXYZ]] begin[{]
local_variable[type[long], yRequest]
if[binary_operation[member[.tileFormat], ==, member[TileFormatType.TMS]]] begin[{]
assign[member[.yRequest], call[TileBoundingBoxUtils.getYAsOppositeTileFormat, parameter[member[.z], Cast(expression=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))]]]
else begin[{]
None
end[}]
assign[member[.zoomUrl], call[.replaceXYZ, parameter[member[.zoomUrl], member[.z], member[.x], member[.yRequest]]]]
else begin[{]
None
end[}]
if[member[.urlHasBoundingBox]] begin[{]
assign[member[.zoomUrl], call[.replaceBoundingBox, parameter[member[.zoomUrl], member[.z], member[.x], member[.y]]]]
else begin[{]
None
end[}]
local_variable[type[URL], url]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=zoomUrl, 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=URL, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to download tile. URL: "), operandr=MemberReference(member=zoomUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", z="), operator=+), operandr=MemberReference(member=z, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", x="), operator=+), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", y="), operator=+), operandr=MemberReference(member=y, 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=GeoPackageException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MalformedURLException']))], finally_block=None, label=None, resources=None)
local_variable[type[int], attempt]
while[literal[true]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=zoomUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=z, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=downloadTile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attempt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=downloadAttempts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to download tile after "), operandr=MemberReference(member=downloadAttempts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" attempts. URL: "), operator=+), operandr=MemberReference(member=zoomUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", z="), operator=+), operandr=MemberReference(member=z, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", x="), operator=+), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", y="), operator=+), operandr=MemberReference(member=y, 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=GeoPackageException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to download tile after attempt "), operandr=MemberReference(member=attempt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" of "), operator=+), operandr=MemberReference(member=downloadAttempts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". URL: "), operator=+), operandr=MemberReference(member=zoomUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", z="), operator=+), operandr=MemberReference(member=z, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", x="), operator=+), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", y="), operator=+), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=attempt, 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)
end[}]
return[member[.bytes]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[protected] Keyword[byte] operator[SEP] operator[SEP] identifier[createTile] operator[SEP] Keyword[int] identifier[z] , Keyword[long] identifier[x] , Keyword[long] identifier[y] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Other[null] operator[SEP] identifier[String] identifier[zoomUrl] operator[=] identifier[tileUrl] operator[SEP] Keyword[if] operator[SEP] identifier[urlHasXYZ] operator[SEP] {
Keyword[long] identifier[yRequest] operator[=] identifier[y] operator[SEP] Keyword[if] operator[SEP] identifier[tileFormat] operator[==] identifier[TileFormatType] operator[SEP] identifier[TMS] operator[SEP] {
identifier[yRequest] operator[=] identifier[TileBoundingBoxUtils] operator[SEP] identifier[getYAsOppositeTileFormat] operator[SEP] identifier[z] , operator[SEP] Keyword[int] operator[SEP] identifier[y] operator[SEP] operator[SEP]
}
identifier[zoomUrl] operator[=] identifier[replaceXYZ] operator[SEP] identifier[zoomUrl] , identifier[z] , identifier[x] , identifier[yRequest] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[urlHasBoundingBox] operator[SEP] {
identifier[zoomUrl] operator[=] identifier[replaceBoundingBox] operator[SEP] identifier[zoomUrl] , identifier[z] , identifier[x] , identifier[y] operator[SEP] operator[SEP]
}
identifier[URL] identifier[url] operator[SEP] Keyword[try] {
identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[zoomUrl] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[MalformedURLException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] literal[String] operator[+] identifier[zoomUrl] operator[+] literal[String] operator[+] identifier[z] operator[+] literal[String] operator[+] identifier[x] operator[+] literal[String] operator[+] identifier[y] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[int] identifier[attempt] operator[=] Other[1] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[try] {
identifier[bytes] operator[=] identifier[downloadTile] operator[SEP] identifier[zoomUrl] , identifier[url] , identifier[z] , identifier[x] , identifier[y] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[attempt] operator[<] identifier[downloadAttempts] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[attempt] operator[+] literal[String] operator[+] identifier[downloadAttempts] operator[+] literal[String] operator[+] identifier[zoomUrl] operator[+] literal[String] operator[+] identifier[z] operator[+] literal[String] operator[+] identifier[x] operator[+] literal[String] operator[+] identifier[y] , identifier[e] operator[SEP] operator[SEP] identifier[attempt] operator[++] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] literal[String] operator[+] identifier[downloadAttempts] operator[+] literal[String] operator[+] identifier[zoomUrl] operator[+] literal[String] operator[+] identifier[z] operator[+] literal[String] operator[+] identifier[x] operator[+] literal[String] operator[+] identifier[y] , identifier[e] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[bytes] operator[SEP]
}
|
public Resource getResource(String name, Locale locale, String encoding) throws IOException {
name = UrlUtils.cleanName(name);
locale = cleanLocale(locale);
return loadResource(name, locale, encoding);
}
|
class class_name[name] begin[{]
method[getResource, return_type[type[Resource]], modifier[public], parameter[name, locale, encoding]] begin[{]
assign[member[.name], call[UrlUtils.cleanName, parameter[member[.name]]]]
assign[member[.locale], call[.cleanLocale, parameter[member[.locale]]]]
return[call[.loadResource, parameter[member[.name], member[.locale], member[.encoding]]]]
end[}]
END[}]
|
Keyword[public] identifier[Resource] identifier[getResource] operator[SEP] identifier[String] identifier[name] , identifier[Locale] identifier[locale] , identifier[String] identifier[encoding] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[name] operator[=] identifier[UrlUtils] operator[SEP] identifier[cleanName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[locale] operator[=] identifier[cleanLocale] operator[SEP] identifier[locale] operator[SEP] operator[SEP] Keyword[return] identifier[loadResource] operator[SEP] identifier[name] , identifier[locale] , identifier[encoding] operator[SEP] operator[SEP]
}
|
@Override
public CompressionInputStream createInputStream(InputStream in,
Decompressor decompressor)
throws IOException {
checkNativeCodeLoaded();
return new BlockDecompressorStream(in, decompressor, 256*1024);
}
|
class class_name[name] begin[{]
method[createInputStream, return_type[type[CompressionInputStream]], modifier[public], parameter[in, decompressor]] begin[{]
call[.checkNativeCodeLoaded, parameter[]]
return[ClassCreator(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=decompressor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=*)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BlockDecompressorStream, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[CompressionInputStream] identifier[createInputStream] operator[SEP] identifier[InputStream] identifier[in] , identifier[Decompressor] identifier[decompressor] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[checkNativeCodeLoaded] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[BlockDecompressorStream] operator[SEP] identifier[in] , identifier[decompressor] , Other[256] operator[*] Other[1024] operator[SEP] operator[SEP]
}
|
private void setDbCodeCollection() {
dbCodeCollection = new ArrayList<String>(shardingNum);
int codeLength = Integer.toBinaryString(shardingNum - 1).length();
for (int i = 0; i < shardingNum; i++) {
String dbcode = Integer.toBinaryString(i);
for (int j = dbcode.length(); j < codeLength; j++) {
dbcode = "0" + dbcode;
}
dbCodeCollection.add(i, dbcode);
}
}
|
class class_name[name] begin[{]
method[setDbCodeCollection, return_type[void], modifier[private], parameter[]] begin[{]
assign[member[.dbCodeCollection], ClassCreator(arguments=[MemberReference(member=shardingNum, 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=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
local_variable[type[int], codeLength]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toBinaryString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=dbcode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dbcode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0"), operandr=MemberReference(member=dbcode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=codeLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=dbcode, selectors=[], type_arguments=None), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dbcode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=dbCodeCollection, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=shardingNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[setDbCodeCollection] operator[SEP] operator[SEP] {
identifier[dbCodeCollection] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[shardingNum] operator[SEP] operator[SEP] Keyword[int] identifier[codeLength] operator[=] identifier[Integer] operator[SEP] identifier[toBinaryString] operator[SEP] identifier[shardingNum] operator[-] Other[1] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[shardingNum] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[dbcode] operator[=] identifier[Integer] operator[SEP] identifier[toBinaryString] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[dbcode] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[<] identifier[codeLength] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[dbcode] operator[=] literal[String] operator[+] identifier[dbcode] operator[SEP]
}
identifier[dbCodeCollection] operator[SEP] identifier[add] operator[SEP] identifier[i] , identifier[dbcode] operator[SEP] operator[SEP]
}
}
|
public final void contains(@NullableDecl Object element) {
if (!Iterables.contains(actual(), element)) {
List<Object> elementList = newArrayList(element);
if (hasMatchingToStringPair(actual(), elementList)) {
failWithoutActual(
fact("expected to contain", element),
fact("an instance of", objectToTypeName(element)),
simpleFact("but did not"),
fact(
"though it did contain",
countDuplicatesAndAddTypeInfo(
retainMatchingToString(actual(), elementList /* itemsToCheck */))),
fullContents());
} else {
failWithActual("expected to contain", element);
}
}
}
|
class class_name[name] begin[{]
method[contains, return_type[void], modifier[final public], parameter[element]] begin[{]
if[call[Iterables.contains, parameter[call[.actual, parameter[]], member[.element]]]] begin[{]
local_variable[type[List], elementList]
if[call[.hasMatchingToStringPair, parameter[call[.actual, parameter[]], member[.elementList]]]] begin[{]
call[.failWithoutActual, parameter[call[.fact, parameter[literal["expected to contain"], member[.element]]], call[.fact, parameter[literal["an instance of"], call[.objectToTypeName, parameter[member[.element]]]]], call[.simpleFact, parameter[literal["but did not"]]], call[.fact, parameter[literal["though it did contain"], call[.countDuplicatesAndAddTypeInfo, parameter[call[.retainMatchingToString, parameter[call[.actual, parameter[]], member[.elementList]]]]]]], call[.fullContents, parameter[]]]]
else begin[{]
call[.failWithActual, parameter[literal["expected to contain"], member[.element]]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[final] Keyword[void] identifier[contains] operator[SEP] annotation[@] identifier[NullableDecl] identifier[Object] identifier[element] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[Iterables] operator[SEP] identifier[contains] operator[SEP] identifier[actual] operator[SEP] operator[SEP] , identifier[element] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[Object] operator[>] identifier[elementList] operator[=] identifier[newArrayList] operator[SEP] identifier[element] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasMatchingToStringPair] operator[SEP] identifier[actual] operator[SEP] operator[SEP] , identifier[elementList] operator[SEP] operator[SEP] {
identifier[failWithoutActual] operator[SEP] identifier[fact] operator[SEP] literal[String] , identifier[element] operator[SEP] , identifier[fact] operator[SEP] literal[String] , identifier[objectToTypeName] operator[SEP] identifier[element] operator[SEP] operator[SEP] , identifier[simpleFact] operator[SEP] literal[String] operator[SEP] , identifier[fact] operator[SEP] literal[String] , identifier[countDuplicatesAndAddTypeInfo] operator[SEP] identifier[retainMatchingToString] operator[SEP] identifier[actual] operator[SEP] operator[SEP] , identifier[elementList] operator[SEP] operator[SEP] operator[SEP] , identifier[fullContents] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[failWithActual] operator[SEP] literal[String] , identifier[element] operator[SEP] operator[SEP]
}
}
}
|
public synchronized TypedProperties putIfAbsent(String key, String value) {
if (getProperty(key) == null) {
put(key, value);
}
return this;
}
|
class class_name[name] begin[{]
method[putIfAbsent, return_type[type[TypedProperties]], modifier[synchronized public], parameter[key, value]] begin[{]
if[binary_operation[call[.getProperty, parameter[member[.key]]], ==, literal[null]]] begin[{]
call[.put, parameter[member[.key], member[.value]]]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] Keyword[synchronized] identifier[TypedProperties] identifier[putIfAbsent] operator[SEP] identifier[String] identifier[key] , identifier[String] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
private void uploadSampleFile() {
mDialog = ProgressDialog.show(MainActivity.this, getText(R.string.boxsdk_Please_wait), getText(R.string.boxsdk_Please_wait));
new Thread() {
@Override
public void run() {
try {
String uploadFileName = "box_logo.png";
InputStream uploadStream = getResources().getAssets().open(uploadFileName);
String destinationFolderId = "0";
String uploadName = "BoxSDKUpload.png";
BoxRequestsFile.UploadFile request = mFileApi.getUploadRequest(uploadStream, uploadName, destinationFolderId);
final BoxFile uploadFileInfo = request.send();
showToast("Uploaded " + uploadFileInfo.getName());
loadRootFolder();
} catch (IOException e) {
e.printStackTrace();
} catch (BoxException e) {
e.printStackTrace();
BoxError error = e.getAsBoxError();
if (error != null && error.getStatus() == HttpURLConnection.HTTP_CONFLICT) {
ArrayList<BoxEntity> conflicts = error.getContextInfo().getConflicts();
if (conflicts != null && conflicts.size() == 1 && conflicts.get(0) instanceof BoxFile) {
uploadNewVersion((BoxFile) conflicts.get(0));
return;
}
}
showToast("Upload failed");
} finally {
mDialog.dismiss();
}
}
}.start();
}
|
class class_name[name] begin[{]
method[uploadSampleFile, return_type[void], modifier[private], parameter[]] begin[{]
assign[member[.mDialog], call[ProgressDialog.show, parameter[THIS[], call[.getText, parameter[member[R.string.boxsdk_Please_wait]]], call[.getText, parameter[member[R.string.boxsdk_Please_wait]]]]]]
ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="box_logo.png"), name=uploadFileName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getAssets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=uploadFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=open, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=uploadStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0"), name=destinationFolderId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="BoxSDKUpload.png"), name=uploadName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=uploadStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uploadName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=destinationFolderId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUploadRequest, postfix_operators=[], prefix_operators=[], qualifier=mFileApi, selectors=[], type_arguments=None), name=request)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BoxRequestsFile, sub_type=ReferenceType(arguments=None, dimensions=None, name=UploadFile, sub_type=None))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=send, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), name=uploadFileInfo)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=BoxFile, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Uploaded "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=uploadFileInfo, selectors=[], type_arguments=None), operator=+)], member=showToast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=loadRootFolder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAsBoxError, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=error)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BoxError, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=error, selectors=[], type_arguments=None), operandr=MemberReference(member=HTTP_CONFLICT, postfix_operators=[], prefix_operators=[], qualifier=HttpURLConnection, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getContextInfo, postfix_operators=[], prefix_operators=[], qualifier=error, selectors=[MethodInvocation(arguments=[], member=getConflicts, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=conflicts)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BoxEntity, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=conflicts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=conflicts, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=conflicts, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=BoxFile, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=conflicts, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=BoxFile, sub_type=None))], member=uploadNewVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Upload failed")], member=showToast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BoxException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=dismiss, postfix_operators=[], prefix_operators=[], qualifier=mDialog, selectors=[], type_arguments=None), label=None)], label=None, resources=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=[MethodInvocation(arguments=[], member=start, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Thread, sub_type=None))
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[uploadSampleFile] operator[SEP] operator[SEP] {
identifier[mDialog] operator[=] identifier[ProgressDialog] operator[SEP] identifier[show] operator[SEP] identifier[MainActivity] operator[SEP] Keyword[this] , identifier[getText] operator[SEP] identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[boxsdk_Please_wait] operator[SEP] , identifier[getText] operator[SEP] identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[boxsdk_Please_wait] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[Thread] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[String] identifier[uploadFileName] operator[=] literal[String] operator[SEP] identifier[InputStream] identifier[uploadStream] operator[=] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[getAssets] operator[SEP] operator[SEP] operator[SEP] identifier[open] operator[SEP] identifier[uploadFileName] operator[SEP] operator[SEP] identifier[String] identifier[destinationFolderId] operator[=] literal[String] operator[SEP] identifier[String] identifier[uploadName] operator[=] literal[String] operator[SEP] identifier[BoxRequestsFile] operator[SEP] identifier[UploadFile] identifier[request] operator[=] identifier[mFileApi] operator[SEP] identifier[getUploadRequest] operator[SEP] identifier[uploadStream] , identifier[uploadName] , identifier[destinationFolderId] operator[SEP] operator[SEP] Keyword[final] identifier[BoxFile] identifier[uploadFileInfo] operator[=] identifier[request] operator[SEP] identifier[send] operator[SEP] operator[SEP] operator[SEP] identifier[showToast] operator[SEP] literal[String] operator[+] identifier[uploadFileInfo] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[loadRootFolder] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[BoxException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] identifier[BoxError] identifier[error] operator[=] identifier[e] operator[SEP] identifier[getAsBoxError] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[error] operator[!=] Other[null] operator[&&] identifier[error] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[==] identifier[HttpURLConnection] operator[SEP] identifier[HTTP_CONFLICT] operator[SEP] {
identifier[ArrayList] operator[<] identifier[BoxEntity] operator[>] identifier[conflicts] operator[=] identifier[error] operator[SEP] identifier[getContextInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getConflicts] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conflicts] operator[!=] Other[null] operator[&&] identifier[conflicts] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[conflicts] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[BoxFile] operator[SEP] {
identifier[uploadNewVersion] operator[SEP] operator[SEP] identifier[BoxFile] operator[SEP] identifier[conflicts] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
identifier[showToast] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[mDialog] operator[SEP] identifier[dismiss] operator[SEP] operator[SEP] operator[SEP]
}
}
} operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public Set<String> keySet() {
Set<String> keys = new HashSet<>();
keysR(root.getLeft(), -1, keys);
return keys;
}
|
class class_name[name] begin[{]
method[keySet, return_type[type[Set]], modifier[public], parameter[]] begin[{]
local_variable[type[Set], keys]
call[.keysR, parameter[call[root.getLeft, parameter[]], literal[1], member[.keys]]]
return[member[.keys]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[String] operator[>] identifier[keySet] operator[SEP] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[keys] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[keysR] operator[SEP] identifier[root] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] , operator[-] Other[1] , identifier[keys] operator[SEP] operator[SEP] Keyword[return] identifier[keys] operator[SEP]
}
|
static PathFileObject createSimplePathFileObject(JavacPathFileManager fileManager,
final Path path) {
return new PathFileObject(fileManager, path) {
@Override
String inferBinaryName(Iterable<? extends Path> paths) {
Path absPath = path.toAbsolutePath();
for (Path p: paths) {
Path ap = p.toAbsolutePath();
if (absPath.startsWith(ap)) {
try {
Path rp = ap.relativize(absPath);
if (rp != null) // maybe null if absPath same as ap
return toBinaryName(rp);
} catch (IllegalArgumentException e) {
// ignore this p if cannot relativize path to p
}
}
}
return null;
}
};
}
|
class class_name[name] begin[{]
method[createSimplePathFileObject, return_type[type[PathFileObject]], modifier[static], parameter[fileManager, path]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=fileManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), name=absPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), name=ap)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=absPath, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=absPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=relativize, postfix_operators=[], prefix_operators=[], qualifier=ap, selectors=[], type_arguments=None), name=rp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=rp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toBinaryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers=set(), name=inferBinaryName, parameters=[FormalParameter(annotations=[], modifiers=set(), name=paths, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))], dimensions=[], name=Iterable, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PathFileObject, sub_type=None))]
end[}]
END[}]
|
Keyword[static] identifier[PathFileObject] identifier[createSimplePathFileObject] operator[SEP] identifier[JavacPathFileManager] identifier[fileManager] , Keyword[final] identifier[Path] identifier[path] operator[SEP] {
Keyword[return] Keyword[new] identifier[PathFileObject] operator[SEP] identifier[fileManager] , identifier[path] operator[SEP] {
annotation[@] identifier[Override] identifier[String] identifier[inferBinaryName] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[Path] operator[>] identifier[paths] operator[SEP] {
identifier[Path] identifier[absPath] operator[=] identifier[path] operator[SEP] identifier[toAbsolutePath] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Path] identifier[p] operator[:] identifier[paths] operator[SEP] {
identifier[Path] identifier[ap] operator[=] identifier[p] operator[SEP] identifier[toAbsolutePath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[absPath] operator[SEP] identifier[startsWith] operator[SEP] identifier[ap] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[Path] identifier[rp] operator[=] identifier[ap] operator[SEP] identifier[relativize] operator[SEP] identifier[absPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rp] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[toBinaryName] operator[SEP] identifier[rp] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[e] operator[SEP] {
}
}
}
Keyword[return] Other[null] operator[SEP]
}
} operator[SEP]
}
|
public <T extends AmazonWebServiceRequest> T withGeneralProgressListener(ProgressListener progressListener) {
setGeneralProgressListener(progressListener);
@SuppressWarnings("unchecked")
T t = (T) this;
return t;
}
|
class class_name[name] begin[{]
method[withGeneralProgressListener, return_type[type[T]], modifier[public], parameter[progressListener]] begin[{]
call[.setGeneralProgressListener, parameter[member[.progressListener]]]
local_variable[type[T], t]
return[member[.t]]
end[}]
END[}]
|
Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[AmazonWebServiceRequest] operator[>] identifier[T] identifier[withGeneralProgressListener] operator[SEP] identifier[ProgressListener] identifier[progressListener] operator[SEP] {
identifier[setGeneralProgressListener] operator[SEP] identifier[progressListener] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[T] identifier[t] operator[=] operator[SEP] identifier[T] operator[SEP] Keyword[this] operator[SEP] Keyword[return] identifier[t] operator[SEP]
}
|
public void setToolDefault(int tool, boolean enabled) {
switch (tool) {
case IBurpExtenderCallbacks.TOOL_PROXY:
if (mCallbacks.loadExtensionSetting(SETTING_PROXY) == null) {
jCheckBoxProxy.setSelected(enabled);
}
break;
case IBurpExtenderCallbacks.TOOL_REPEATER:
if (mCallbacks.loadExtensionSetting(SETTING_REPEATER) == null) {
jCheckBoxRepeater.setSelected(enabled);
}
break;
case IBurpExtenderCallbacks.TOOL_SCANNER:
if (mCallbacks.loadExtensionSetting(SETTING_SCANNER) == null) {
jCheckBoxScanner.setSelected(enabled);
}
break;
case IBurpExtenderCallbacks.TOOL_INTRUDER:
if (mCallbacks.loadExtensionSetting(SETTING_INTRUDER) == null) {
jCheckBoxIntruder.setSelected(enabled);
}
break;
case IBurpExtenderCallbacks.TOOL_SEQUENCER:
if (mCallbacks.loadExtensionSetting(SETTING_SEQUENCER) == null) {
jCheckBoxProxy.setSelected(enabled);
}
break;
case IBurpExtenderCallbacks.TOOL_SPIDER:
if (mCallbacks.loadExtensionSetting(SETTING_SPIDER) == null) {
jCheckBoxSpider.setSelected(enabled);
}
break;
case IBurpExtenderCallbacks.TOOL_EXTENDER:
if (mCallbacks.loadExtensionSetting(SETTING_EXTENDER) == null) {
jCheckBoxExtender.setSelected(enabled);
}
break;
default:
break;
}
}
|
class class_name[name] begin[{]
method[setToolDefault, return_type[void], modifier[public], parameter[tool, enabled]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=TOOL_PROXY, postfix_operators=[], prefix_operators=[], qualifier=IBurpExtenderCallbacks, selectors=[])], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=SETTING_PROXY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadExtensionSetting, postfix_operators=[], prefix_operators=[], qualifier=mCallbacks, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSelected, postfix_operators=[], prefix_operators=[], qualifier=jCheckBoxProxy, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TOOL_REPEATER, postfix_operators=[], prefix_operators=[], qualifier=IBurpExtenderCallbacks, selectors=[])], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=SETTING_REPEATER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadExtensionSetting, postfix_operators=[], prefix_operators=[], qualifier=mCallbacks, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSelected, postfix_operators=[], prefix_operators=[], qualifier=jCheckBoxRepeater, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TOOL_SCANNER, postfix_operators=[], prefix_operators=[], qualifier=IBurpExtenderCallbacks, selectors=[])], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=SETTING_SCANNER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadExtensionSetting, postfix_operators=[], prefix_operators=[], qualifier=mCallbacks, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSelected, postfix_operators=[], prefix_operators=[], qualifier=jCheckBoxScanner, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TOOL_INTRUDER, postfix_operators=[], prefix_operators=[], qualifier=IBurpExtenderCallbacks, selectors=[])], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=SETTING_INTRUDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadExtensionSetting, postfix_operators=[], prefix_operators=[], qualifier=mCallbacks, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSelected, postfix_operators=[], prefix_operators=[], qualifier=jCheckBoxIntruder, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TOOL_SEQUENCER, postfix_operators=[], prefix_operators=[], qualifier=IBurpExtenderCallbacks, selectors=[])], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=SETTING_SEQUENCER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadExtensionSetting, postfix_operators=[], prefix_operators=[], qualifier=mCallbacks, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSelected, postfix_operators=[], prefix_operators=[], qualifier=jCheckBoxProxy, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TOOL_SPIDER, postfix_operators=[], prefix_operators=[], qualifier=IBurpExtenderCallbacks, selectors=[])], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=SETTING_SPIDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadExtensionSetting, postfix_operators=[], prefix_operators=[], qualifier=mCallbacks, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSelected, postfix_operators=[], prefix_operators=[], qualifier=jCheckBoxSpider, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TOOL_EXTENDER, postfix_operators=[], prefix_operators=[], qualifier=IBurpExtenderCallbacks, selectors=[])], statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=SETTING_EXTENDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadExtensionSetting, postfix_operators=[], prefix_operators=[], qualifier=mCallbacks, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSelected, postfix_operators=[], prefix_operators=[], qualifier=jCheckBoxExtender, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MemberReference(member=tool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setToolDefault] operator[SEP] Keyword[int] identifier[tool] , Keyword[boolean] identifier[enabled] operator[SEP] {
Keyword[switch] operator[SEP] identifier[tool] operator[SEP] {
Keyword[case] identifier[IBurpExtenderCallbacks] operator[SEP] identifier[TOOL_PROXY] operator[:] Keyword[if] operator[SEP] identifier[mCallbacks] operator[SEP] identifier[loadExtensionSetting] operator[SEP] identifier[SETTING_PROXY] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[jCheckBoxProxy] operator[SEP] identifier[setSelected] operator[SEP] identifier[enabled] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[IBurpExtenderCallbacks] operator[SEP] identifier[TOOL_REPEATER] operator[:] Keyword[if] operator[SEP] identifier[mCallbacks] operator[SEP] identifier[loadExtensionSetting] operator[SEP] identifier[SETTING_REPEATER] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[jCheckBoxRepeater] operator[SEP] identifier[setSelected] operator[SEP] identifier[enabled] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[IBurpExtenderCallbacks] operator[SEP] identifier[TOOL_SCANNER] operator[:] Keyword[if] operator[SEP] identifier[mCallbacks] operator[SEP] identifier[loadExtensionSetting] operator[SEP] identifier[SETTING_SCANNER] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[jCheckBoxScanner] operator[SEP] identifier[setSelected] operator[SEP] identifier[enabled] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[IBurpExtenderCallbacks] operator[SEP] identifier[TOOL_INTRUDER] operator[:] Keyword[if] operator[SEP] identifier[mCallbacks] operator[SEP] identifier[loadExtensionSetting] operator[SEP] identifier[SETTING_INTRUDER] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[jCheckBoxIntruder] operator[SEP] identifier[setSelected] operator[SEP] identifier[enabled] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[IBurpExtenderCallbacks] operator[SEP] identifier[TOOL_SEQUENCER] operator[:] Keyword[if] operator[SEP] identifier[mCallbacks] operator[SEP] identifier[loadExtensionSetting] operator[SEP] identifier[SETTING_SEQUENCER] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[jCheckBoxProxy] operator[SEP] identifier[setSelected] operator[SEP] identifier[enabled] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[IBurpExtenderCallbacks] operator[SEP] identifier[TOOL_SPIDER] operator[:] Keyword[if] operator[SEP] identifier[mCallbacks] operator[SEP] identifier[loadExtensionSetting] operator[SEP] identifier[SETTING_SPIDER] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[jCheckBoxSpider] operator[SEP] identifier[setSelected] operator[SEP] identifier[enabled] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[IBurpExtenderCallbacks] operator[SEP] identifier[TOOL_EXTENDER] operator[:] Keyword[if] operator[SEP] identifier[mCallbacks] operator[SEP] identifier[loadExtensionSetting] operator[SEP] identifier[SETTING_EXTENDER] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[jCheckBoxExtender] operator[SEP] identifier[setSelected] operator[SEP] identifier[enabled] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP]
}
}
|
ObjectStreamField[] fields() {
if (fields == null) {
Class<?> forCl = forClass();
if (forCl != null && isSerializable() && !forCl.isArray()) {
buildFieldDescriptors(forCl.getDeclaredFields());
} else {
// Externalizables or arrays do not need FieldDesc info
setFields(NO_FIELDS);
}
}
return fields;
}
|
class class_name[name] begin[{]
method[fields, return_type[type[ObjectStreamField]], modifier[default], parameter[]] begin[{]
if[binary_operation[member[.fields], ==, literal[null]]] begin[{]
local_variable[type[Class], forCl]
if[binary_operation[binary_operation[binary_operation[member[.forCl], !=, literal[null]], &&, call[.isSerializable, parameter[]]], &&, call[forCl.isArray, parameter[]]]] begin[{]
call[.buildFieldDescriptors, parameter[call[forCl.getDeclaredFields, parameter[]]]]
else begin[{]
call[.setFields, parameter[member[.NO_FIELDS]]]
end[}]
else begin[{]
None
end[}]
return[member[.fields]]
end[}]
END[}]
|
identifier[ObjectStreamField] operator[SEP] operator[SEP] identifier[fields] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[fields] operator[==] Other[null] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[forCl] operator[=] identifier[forClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[forCl] operator[!=] Other[null] operator[&&] identifier[isSerializable] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[forCl] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] {
identifier[buildFieldDescriptors] operator[SEP] identifier[forCl] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[setFields] operator[SEP] identifier[NO_FIELDS] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[fields] operator[SEP]
}
|
public Collector<Point, ?, Length> toTourLength() {
return Collector.of(
() -> new LengthCollector(this),
LengthCollector::add,
LengthCollector::combine,
LengthCollector::tourLength
);
}
|
class class_name[name] begin[{]
method[toTourLength, return_type[type[Collector]], modifier[public], parameter[]] begin[{]
return[call[Collector.of, parameter[LambdaExpression(body=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LengthCollector, sub_type=None)), parameters=[]), MethodReference(expression=MemberReference(member=LengthCollector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodReference(expression=MemberReference(member=LengthCollector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=combine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodReference(expression=MemberReference(member=LengthCollector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=tourLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]]
end[}]
END[}]
|
Keyword[public] identifier[Collector] operator[<] identifier[Point] , operator[?] , identifier[Length] operator[>] identifier[toTourLength] operator[SEP] operator[SEP] {
Keyword[return] identifier[Collector] operator[SEP] identifier[of] operator[SEP] operator[SEP] operator[SEP] operator[->] Keyword[new] identifier[LengthCollector] operator[SEP] Keyword[this] operator[SEP] , identifier[LengthCollector] operator[::] identifier[add] , identifier[LengthCollector] operator[::] identifier[combine] , identifier[LengthCollector] operator[::] identifier[tourLength] operator[SEP] operator[SEP]
}
|
public static LibertyVersion valueOf(String versionString) {
if (versionString == null) {
return null;
}
versionString = versionString.trim();
Matcher versionMatcher = VALID_VERSION.matcher(versionString);
if (!versionMatcher.matches()) {
return null;
}
return new LibertyVersion(Integer.parseInt(versionMatcher.group(1)), Integer.parseInt(versionMatcher.group(2)), Integer.parseInt(versionMatcher.group(3)), Integer.parseInt(versionMatcher.group(4)));
}
|
class class_name[name] begin[{]
method[valueOf, return_type[type[LibertyVersion]], modifier[public static], parameter[versionString]] begin[{]
if[binary_operation[member[.versionString], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
assign[member[.versionString], call[versionString.trim, parameter[]]]
local_variable[type[Matcher], versionMatcher]
if[call[versionMatcher.matches, parameter[]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=versionMatcher, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=group, postfix_operators=[], prefix_operators=[], qualifier=versionMatcher, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=group, postfix_operators=[], prefix_operators=[], qualifier=versionMatcher, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], member=group, postfix_operators=[], prefix_operators=[], qualifier=versionMatcher, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LibertyVersion, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[LibertyVersion] identifier[valueOf] operator[SEP] identifier[String] identifier[versionString] operator[SEP] {
Keyword[if] operator[SEP] identifier[versionString] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[versionString] operator[=] identifier[versionString] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[Matcher] identifier[versionMatcher] operator[=] identifier[VALID_VERSION] operator[SEP] identifier[matcher] operator[SEP] identifier[versionString] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[versionMatcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] Keyword[new] identifier[LibertyVersion] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[versionMatcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] , identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[versionMatcher] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] , identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[versionMatcher] operator[SEP] identifier[group] operator[SEP] Other[3] operator[SEP] operator[SEP] , identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[versionMatcher] operator[SEP] identifier[group] operator[SEP] Other[4] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("static-method")
public boolean isAssigned(final EObject object) {
assert object != null;
return object.eAdapters().contains(ASSIGNMENT_MARKER);
}
|
class class_name[name] begin[{]
method[isAssigned, return_type[type[boolean]], modifier[public], parameter[object]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
return[call[object.eAdapters, parameter[]]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[boolean] identifier[isAssigned] operator[SEP] Keyword[final] identifier[EObject] identifier[object] operator[SEP] {
Keyword[assert] identifier[object] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[object] operator[SEP] identifier[eAdapters] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[ASSIGNMENT_MARKER] operator[SEP] operator[SEP]
}
|
public final Flux<List<T>> buffer(Duration bufferingTimespan, Scheduler timer) {
return buffer(interval(bufferingTimespan, timer));
}
|
class class_name[name] begin[{]
method[buffer, return_type[type[Flux]], modifier[final public], parameter[bufferingTimespan, timer]] begin[{]
return[call[.buffer, parameter[call[.interval, parameter[member[.bufferingTimespan], member[.timer]]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[final] identifier[Flux] operator[<] identifier[List] operator[<] identifier[T] operator[>] operator[>] identifier[buffer] operator[SEP] identifier[Duration] identifier[bufferingTimespan] , identifier[Scheduler] identifier[timer] operator[SEP] {
Keyword[return] identifier[buffer] operator[SEP] identifier[interval] operator[SEP] identifier[bufferingTimespan] , identifier[timer] operator[SEP] operator[SEP] operator[SEP]
}
|
public com.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig getNumericalStatsConfig() {
if (typeCase_ == 1) {
return (com.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig) type_;
}
return com.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.getDefaultInstance();
}
|
class class_name[name] begin[{]
method[getNumericalStatsConfig, return_type[type[com]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.typeCase_], ==, literal[1]]] begin[{]
return[Cast(expression=MemberReference(member=type_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=google, sub_type=ReferenceType(arguments=None, dimensions=None, name=privacy, sub_type=ReferenceType(arguments=None, dimensions=None, name=dlp, sub_type=ReferenceType(arguments=None, dimensions=None, name=v2, sub_type=ReferenceType(arguments=None, dimensions=None, name=PrivacyMetric, sub_type=ReferenceType(arguments=None, dimensions=None, name=NumericalStatsConfig, sub_type=None))))))))]
else begin[{]
None
end[}]
return[call[com.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.getDefaultInstance, parameter[]]]
end[}]
END[}]
|
Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[privacy] operator[SEP] identifier[dlp] operator[SEP] identifier[v2] operator[SEP] identifier[PrivacyMetric] operator[SEP] identifier[NumericalStatsConfig] identifier[getNumericalStatsConfig] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[typeCase_] operator[==] Other[1] operator[SEP] {
Keyword[return] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[privacy] operator[SEP] identifier[dlp] operator[SEP] identifier[v2] operator[SEP] identifier[PrivacyMetric] operator[SEP] identifier[NumericalStatsConfig] operator[SEP] identifier[type_] operator[SEP]
}
Keyword[return] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[privacy] operator[SEP] identifier[dlp] operator[SEP] identifier[v2] operator[SEP] identifier[PrivacyMetric] operator[SEP] identifier[NumericalStatsConfig] operator[SEP] identifier[getDefaultInstance] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
if (m_list.size() < 1)
{
if (false == parse(attr))
{
return false;
}
}
if (m_list.size() < 1)
{
return false;
}
context.path(m_list);
return true;
}
|
class class_name[name] begin[{]
method[prepare, return_type[type[boolean]], modifier[protected], parameter[context, attr, alpha]] begin[{]
if[binary_operation[call[m_list.size, parameter[]], <, literal[1]]] begin[{]
if[binary_operation[literal[false], ==, call[.parse, parameter[member[.attr]]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[call[m_list.size, parameter[]], <, literal[1]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
call[context.path, parameter[member[.m_list]]]
return[literal[true]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[protected] Keyword[boolean] identifier[prepare] operator[SEP] Keyword[final] identifier[Context2D] identifier[context] , Keyword[final] identifier[Attributes] identifier[attr] , Keyword[final] Keyword[double] identifier[alpha] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[1] operator[SEP] {
Keyword[if] operator[SEP] literal[boolean] operator[==] identifier[parse] operator[SEP] identifier[attr] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[m_list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[1] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[context] operator[SEP] identifier[path] operator[SEP] identifier[m_list] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
public static boolean eq(String s1, String s2, int modifier) {
return isEqual(s1, s2, modifier);
}
|
class class_name[name] begin[{]
method[eq, return_type[type[boolean]], modifier[public static], parameter[s1, s2, modifier]] begin[{]
return[call[.isEqual, parameter[member[.s1], member[.s2], member[.modifier]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[boolean] identifier[eq] operator[SEP] identifier[String] identifier[s1] , identifier[String] identifier[s2] , Keyword[int] identifier[modifier] operator[SEP] {
Keyword[return] identifier[isEqual] operator[SEP] identifier[s1] , identifier[s2] , identifier[modifier] operator[SEP] operator[SEP]
}
|
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Single<T> delaySubscription(long time, TimeUnit unit) {
return delaySubscription(time, unit, Schedulers.computation());
}
|
class class_name[name] begin[{]
method[delaySubscription, return_type[type[Single]], modifier[final public], parameter[time, unit]] begin[{]
return[call[.delaySubscription, parameter[member[.time], member[.unit], call[Schedulers.computation, parameter[]]]]]
end[}]
END[}]
|
annotation[@] identifier[CheckReturnValue] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[COMPUTATION] operator[SEP] Keyword[public] Keyword[final] identifier[Single] operator[<] identifier[T] operator[>] identifier[delaySubscription] operator[SEP] Keyword[long] identifier[time] , identifier[TimeUnit] identifier[unit] operator[SEP] {
Keyword[return] identifier[delaySubscription] operator[SEP] identifier[time] , identifier[unit] , identifier[Schedulers] operator[SEP] identifier[computation] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Deprecated
public ClientVpnEndpoint withAssociatedTargetNetworks(java.util.Collection<AssociatedTargetNetwork> associatedTargetNetworks) {
setAssociatedTargetNetworks(associatedTargetNetworks);
return this;
}
|
class class_name[name] begin[{]
method[withAssociatedTargetNetworks, return_type[type[ClientVpnEndpoint]], modifier[public], parameter[associatedTargetNetworks]] begin[{]
call[.setAssociatedTargetNetworks, parameter[member[.associatedTargetNetworks]]]
return[THIS[]]
end[}]
END[}]
|
annotation[@] identifier[Deprecated] Keyword[public] identifier[ClientVpnEndpoint] identifier[withAssociatedTargetNetworks] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[AssociatedTargetNetwork] operator[>] identifier[associatedTargetNetworks] operator[SEP] {
identifier[setAssociatedTargetNetworks] operator[SEP] identifier[associatedTargetNetworks] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public TwoPhaseIterator asTwoPhaseIterator() {
if (!query.twoPhaseIteratorAllowed()) {
return null;
} else {
TwoPhaseIterator originalTwoPhaseIterator = subSpans.asTwoPhaseIterator();
if (originalTwoPhaseIterator != null) {
return new TwoPhaseIterator(originalTwoPhaseIterator.approximation()) {
@Override
public boolean matches() throws IOException {
return originalTwoPhaseIterator.matches()
&& twoPhaseCurrentDocMatches();
}
@Override
public float matchCost() {
return originalTwoPhaseIterator.matchCost();
}
};
} else {
return new TwoPhaseIterator(subSpans) {
@Override
public boolean matches() throws IOException {
return twoPhaseCurrentDocMatches();
}
@Override
public float matchCost() {
return subSpans.positionsCost();
}
};
}
}
}
|
class class_name[name] begin[{]
method[asTwoPhaseIterator, return_type[type[TwoPhaseIterator]], modifier[public], parameter[]] begin[{]
if[call[query.twoPhaseIteratorAllowed, parameter[]]] begin[{]
return[literal[null]]
else begin[{]
local_variable[type[TwoPhaseIterator], originalTwoPhaseIterator]
if[binary_operation[member[.originalTwoPhaseIterator], !=, literal[null]]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=approximation, postfix_operators=[], prefix_operators=[], qualifier=originalTwoPhaseIterator, selectors=[], type_arguments=None)], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[], member=matches, postfix_operators=[], prefix_operators=[], qualifier=originalTwoPhaseIterator, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=twoPhaseCurrentDocMatches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), label=None)], documentation=None, modifiers={'public'}, name=matches, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=['IOException'], type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=matchCost, postfix_operators=[], prefix_operators=[], qualifier=originalTwoPhaseIterator, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=matchCost, parameters=[], return_type=BasicType(dimensions=[], name=float), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TwoPhaseIterator, sub_type=None))]
else begin[{]
return[ClassCreator(arguments=[MemberReference(member=subSpans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=twoPhaseCurrentDocMatches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=matches, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=['IOException'], type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=positionsCost, postfix_operators=[], prefix_operators=[], qualifier=subSpans, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=matchCost, parameters=[], return_type=BasicType(dimensions=[], name=float), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TwoPhaseIterator, sub_type=None))]
end[}]
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[TwoPhaseIterator] identifier[asTwoPhaseIterator] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[query] operator[SEP] identifier[twoPhaseIteratorAllowed] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] {
identifier[TwoPhaseIterator] identifier[originalTwoPhaseIterator] operator[=] identifier[subSpans] operator[SEP] identifier[asTwoPhaseIterator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[originalTwoPhaseIterator] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[TwoPhaseIterator] operator[SEP] identifier[originalTwoPhaseIterator] operator[SEP] identifier[approximation] operator[SEP] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[originalTwoPhaseIterator] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[&&] identifier[twoPhaseCurrentDocMatches] operator[SEP] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] Keyword[float] identifier[matchCost] operator[SEP] operator[SEP] {
Keyword[return] identifier[originalTwoPhaseIterator] operator[SEP] identifier[matchCost] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[TwoPhaseIterator] operator[SEP] identifier[subSpans] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[twoPhaseCurrentDocMatches] operator[SEP] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] Keyword[float] identifier[matchCost] operator[SEP] operator[SEP] {
Keyword[return] identifier[subSpans] operator[SEP] identifier[positionsCost] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP]
}
}
}
|
public static <T extends Enum> T getExtension(SlingHttpServletRequest request, T defaultValue) {
String extension = request.getRequestPathInfo().getExtension();
if (extension != null) {
Class type = defaultValue.getClass();
try {
T value = (T) T.valueOf(type, extension.toLowerCase());
return value;
} catch (IllegalArgumentException iaex) {
// ok, use default
}
}
return defaultValue;
}
|
class class_name[name] begin[{]
method[getExtension, return_type[type[T]], modifier[public static], parameter[request, defaultValue]] begin[{]
local_variable[type[String], extension]
if[binary_operation[member[.extension], !=, literal[null]]] begin[{]
local_variable[type[Class], type]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=extension, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=T, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), ReturnStatement(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=iaex, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[.defaultValue]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Enum] operator[>] identifier[T] identifier[getExtension] operator[SEP] identifier[SlingHttpServletRequest] identifier[request] , identifier[T] identifier[defaultValue] operator[SEP] {
identifier[String] identifier[extension] operator[=] identifier[request] operator[SEP] identifier[getRequestPathInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getExtension] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[extension] operator[!=] Other[null] operator[SEP] {
identifier[Class] identifier[type] operator[=] identifier[defaultValue] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[T] identifier[value] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[T] operator[SEP] identifier[valueOf] operator[SEP] identifier[type] , identifier[extension] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[iaex] operator[SEP] {
}
}
Keyword[return] identifier[defaultValue] operator[SEP]
}
|
public static XLinkConnectorView[] getViewsOfRegistration(XLinkConnectorRegistration registration) {
List<XLinkConnectorView> viewsOfRegistration = new ArrayList<XLinkConnectorView>();
Map<ModelDescription, XLinkConnectorView[]> modelsToViews = registration.getModelsToViews();
for (XLinkConnectorView[] views : modelsToViews.values()) {
for (int i = 0; i < views.length; i++) {
XLinkConnectorView view = views[i];
if (!viewsOfRegistration.contains(view)) {
viewsOfRegistration.add(view);
}
}
}
return viewsOfRegistration.toArray(new XLinkConnectorView[0]);
}
|
class class_name[name] begin[{]
method[getViewsOfRegistration, return_type[type[XLinkConnectorView]], modifier[public static], parameter[registration]] begin[{]
local_variable[type[List], viewsOfRegistration]
local_variable[type[Map], modelsToViews]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=views, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=view)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XLinkConnectorView, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=viewsOfRegistration, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=viewsOfRegistration, 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=views, 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)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=modelsToViews, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=views)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=XLinkConnectorView, sub_type=None))), label=None)
return[call[viewsOfRegistration.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=XLinkConnectorView, sub_type=None))]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[XLinkConnectorView] operator[SEP] operator[SEP] identifier[getViewsOfRegistration] operator[SEP] identifier[XLinkConnectorRegistration] identifier[registration] operator[SEP] {
identifier[List] operator[<] identifier[XLinkConnectorView] operator[>] identifier[viewsOfRegistration] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[XLinkConnectorView] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[ModelDescription] , identifier[XLinkConnectorView] operator[SEP] operator[SEP] operator[>] identifier[modelsToViews] operator[=] identifier[registration] operator[SEP] identifier[getModelsToViews] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[XLinkConnectorView] operator[SEP] operator[SEP] identifier[views] operator[:] identifier[modelsToViews] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[views] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[XLinkConnectorView] identifier[view] operator[=] identifier[views] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[viewsOfRegistration] operator[SEP] identifier[contains] operator[SEP] identifier[view] operator[SEP] operator[SEP] {
identifier[viewsOfRegistration] operator[SEP] identifier[add] operator[SEP] identifier[view] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[viewsOfRegistration] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[XLinkConnectorView] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public final void invokeQuery(InboxAmp inbox, StubAmp actorDeliver)
{
try {
MethodAmp method = method();
StubAmp actorMessage = serviceRef().stub();
StubStateAmp load = actorDeliver.load(actorMessage, this);
load.inPipe(actorDeliver, actorMessage,
method,
getHeaders(),
this,
_args);
} catch (Throwable e) {
fail(e);
}
}
|
class class_name[name] begin[{]
method[invokeQuery, return_type[void], modifier[final public], parameter[inbox, actorDeliver]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodAmp, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=serviceRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=stub, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=actorMessage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StubAmp, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=actorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=actorDeliver, selectors=[], type_arguments=None), name=load)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StubStateAmp, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=actorDeliver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=actorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getHeaders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=_args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=inPipe, postfix_operators=[], prefix_operators=[], qualifier=load, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[invokeQuery] operator[SEP] identifier[InboxAmp] identifier[inbox] , identifier[StubAmp] identifier[actorDeliver] operator[SEP] {
Keyword[try] {
identifier[MethodAmp] identifier[method] operator[=] identifier[method] operator[SEP] operator[SEP] operator[SEP] identifier[StubAmp] identifier[actorMessage] operator[=] identifier[serviceRef] operator[SEP] operator[SEP] operator[SEP] identifier[stub] operator[SEP] operator[SEP] operator[SEP] identifier[StubStateAmp] identifier[load] operator[=] identifier[actorDeliver] operator[SEP] identifier[load] operator[SEP] identifier[actorMessage] , Keyword[this] operator[SEP] operator[SEP] identifier[load] operator[SEP] identifier[inPipe] operator[SEP] identifier[actorDeliver] , identifier[actorMessage] , identifier[method] , identifier[getHeaders] operator[SEP] operator[SEP] , Keyword[this] , identifier[_args] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
identifier[fail] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public String fixPropertyName(String name) {
name = super.fixPropertyName(name);
if ("cssFloat".equals(name)) {
return "styleFloat";
} else if ("class".equals(name)) {
return "className";
}
return name;
}
|
class class_name[name] begin[{]
method[fixPropertyName, return_type[type[String]], modifier[public], parameter[name]] begin[{]
assign[member[.name], SuperMethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fixPropertyName, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
if[literal["cssFloat"]] begin[{]
return[literal["styleFloat"]]
else begin[{]
if[literal["class"]] begin[{]
return[literal["className"]]
else begin[{]
None
end[}]
end[}]
return[member[.name]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[fixPropertyName] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[name] operator[=] Keyword[super] operator[SEP] identifier[fixPropertyName] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[return] identifier[name] operator[SEP]
}
|
public static String snakeToCamel(String snake, boolean upper) {
StringBuilder sb = new StringBuilder();
boolean firstWord = true;
for (String word : snake.split("_")) {
if (!word.isEmpty()) {
if (firstWord && !upper) {
sb.append(word.toLowerCase());
} else {
sb.append(Character.toUpperCase(word.charAt(0))).append(word.substring(1).toLowerCase());
}
firstWord = false;
}
}
return sb.toString();
}
|
class class_name[name] begin[{]
method[snakeToCamel, return_type[type[String]], modifier[public static], parameter[snake, upper]] begin[{]
local_variable[type[StringBuilder], sb]
local_variable[type[boolean], firstWord]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=word, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=firstWord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=upper, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[], type_arguments=None)], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=firstWord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_")], member=split, postfix_operators=[], prefix_operators=[], qualifier=snake, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=word)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[call[sb.toString, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[snakeToCamel] operator[SEP] identifier[String] identifier[snake] , Keyword[boolean] identifier[upper] operator[SEP] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[firstWord] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[word] operator[:] identifier[snake] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[word] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[firstWord] operator[&&] operator[!] identifier[upper] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[word] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[word] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[word] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[firstWord] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static JSpinner createSpinner(
SpinnerModel model, final int fractionDigits)
{
return new JSpinner(model)
{
/**
* Serial UID
*/
private static final long serialVersionUID = -9185142711286020504L;
@Override
protected JComponent createEditor(SpinnerModel model)
{
if (model instanceof SpinnerNumberModel)
{
NumberEditor editor = new NumberEditor(this);
DecimalFormat format = editor.getFormat();
format.setMaximumFractionDigits(fractionDigits);
return editor;
}
return super.createEditor(model);
}
};
}
|
class class_name[name] begin[{]
method[createSpinner, return_type[type[JSpinner]], modifier[public static], parameter[model, fractionDigits]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=9185142711286020504L), name=serialVersionUID)], documentation=/**
* Serial UID
*/, modifiers={'final', 'private', 'static'}, type=BasicType(dimensions=[], name=long)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SpinnerNumberModel, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NumberEditor, sub_type=None)), name=editor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NumberEditor, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFormat, postfix_operators=[], prefix_operators=[], qualifier=editor, selectors=[], type_arguments=None), name=format)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DecimalFormat, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fractionDigits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMaximumFractionDigits, postfix_operators=[], prefix_operators=[], qualifier=format, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=editor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), ReturnStatement(expression=SuperMethodInvocation(arguments=[MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createEditor, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'protected'}, name=createEditor, parameters=[FormalParameter(annotations=[], modifiers=set(), name=model, type=ReferenceType(arguments=None, dimensions=[], name=SpinnerModel, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=JComponent, sub_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=JSpinner, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[JSpinner] identifier[createSpinner] operator[SEP] identifier[SpinnerModel] identifier[model] , Keyword[final] Keyword[int] identifier[fractionDigits] operator[SEP] {
Keyword[return] Keyword[new] identifier[JSpinner] operator[SEP] identifier[model] operator[SEP] {
Keyword[private] Keyword[static] Keyword[final] Keyword[long] identifier[serialVersionUID] operator[=] operator[-] Other[9185142711286020504L] operator[SEP] annotation[@] identifier[Override] Keyword[protected] identifier[JComponent] identifier[createEditor] operator[SEP] identifier[SpinnerModel] identifier[model] operator[SEP] {
Keyword[if] operator[SEP] identifier[model] Keyword[instanceof] identifier[SpinnerNumberModel] operator[SEP] {
identifier[NumberEditor] identifier[editor] operator[=] Keyword[new] identifier[NumberEditor] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[DecimalFormat] identifier[format] operator[=] identifier[editor] operator[SEP] identifier[getFormat] operator[SEP] operator[SEP] operator[SEP] identifier[format] operator[SEP] identifier[setMaximumFractionDigits] operator[SEP] identifier[fractionDigits] operator[SEP] operator[SEP] Keyword[return] identifier[editor] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[createEditor] operator[SEP] identifier[model] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public void marshall(ShareResult shareResult, ProtocolMarshaller protocolMarshaller) {
if (shareResult == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(shareResult.getPrincipalId(), PRINCIPALID_BINDING);
protocolMarshaller.marshall(shareResult.getInviteePrincipalId(), INVITEEPRINCIPALID_BINDING);
protocolMarshaller.marshall(shareResult.getRole(), ROLE_BINDING);
protocolMarshaller.marshall(shareResult.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(shareResult.getShareId(), SHAREID_BINDING);
protocolMarshaller.marshall(shareResult.getStatusMessage(), STATUSMESSAGE_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[shareResult, protocolMarshaller]] begin[{]
if[binary_operation[member[.shareResult], ==, 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=getPrincipalId, postfix_operators=[], prefix_operators=[], qualifier=shareResult, selectors=[], type_arguments=None), MemberReference(member=PRINCIPALID_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=getInviteePrincipalId, postfix_operators=[], prefix_operators=[], qualifier=shareResult, selectors=[], type_arguments=None), MemberReference(member=INVITEEPRINCIPALID_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=getRole, postfix_operators=[], prefix_operators=[], qualifier=shareResult, selectors=[], type_arguments=None), MemberReference(member=ROLE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=shareResult, selectors=[], type_arguments=None), MemberReference(member=STATUS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getShareId, postfix_operators=[], prefix_operators=[], qualifier=shareResult, selectors=[], type_arguments=None), MemberReference(member=SHAREID_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=getStatusMessage, postfix_operators=[], prefix_operators=[], qualifier=shareResult, selectors=[], type_arguments=None), MemberReference(member=STATUSMESSAGE_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[ShareResult] identifier[shareResult] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[shareResult] 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[shareResult] operator[SEP] identifier[getPrincipalId] operator[SEP] operator[SEP] , identifier[PRINCIPALID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[shareResult] operator[SEP] identifier[getInviteePrincipalId] operator[SEP] operator[SEP] , identifier[INVITEEPRINCIPALID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[shareResult] operator[SEP] identifier[getRole] operator[SEP] operator[SEP] , identifier[ROLE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[shareResult] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[shareResult] operator[SEP] identifier[getShareId] operator[SEP] operator[SEP] , identifier[SHAREID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[shareResult] operator[SEP] identifier[getStatusMessage] operator[SEP] operator[SEP] , identifier[STATUSMESSAGE_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]
}
}
|
@SuppressWarnings("unchecked")
@Override
public EList<IfcRelAssignsToControl> getControls() {
return (EList<IfcRelAssignsToControl>) eGet(Ifc4Package.Literals.IFC_CONTROL__CONTROLS, true);
}
|
class class_name[name] begin[{]
method[getControls, return_type[type[EList]], modifier[public], parameter[]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=IFC_CONTROL__CONTROLS, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IfcRelAssignsToControl, sub_type=None))], dimensions=[], name=EList, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[EList] operator[<] identifier[IfcRelAssignsToControl] operator[>] identifier[getControls] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[IfcRelAssignsToControl] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[Literals] operator[SEP] identifier[IFC_CONTROL__CONTROLS] , literal[boolean] operator[SEP] operator[SEP]
}
|
@Transactional
public void deleteNamespace(String namespace) {
List<L10nString> namespaceEntities = getL10nStrings(namespace);
dataService.delete(L10N_STRING, namespaceEntities.stream());
}
|
class class_name[name] begin[{]
method[deleteNamespace, return_type[void], modifier[public], parameter[namespace]] begin[{]
local_variable[type[List], namespaceEntities]
call[dataService.delete, parameter[member[.L10N_STRING], call[namespaceEntities.stream, parameter[]]]]
end[}]
END[}]
|
annotation[@] identifier[Transactional] Keyword[public] Keyword[void] identifier[deleteNamespace] operator[SEP] identifier[String] identifier[namespace] operator[SEP] {
identifier[List] operator[<] identifier[L10nString] operator[>] identifier[namespaceEntities] operator[=] identifier[getL10nStrings] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] identifier[dataService] operator[SEP] identifier[delete] operator[SEP] identifier[L10N_STRING] , identifier[namespaceEntities] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings({ "rawtypes", "unchecked" })
@BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> concatArrayEager(MaybeSource<? extends T>... sources) {
return Flowable.fromArray(sources).concatMapEager((Function)MaybeToPublisher.instance());
}
|
class class_name[name] begin[{]
method[concatArrayEager, return_type[type[Flowable]], modifier[public static], parameter[sources]] begin[{]
return[call[Flowable.fromArray, parameter[member[.sources]]]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] annotation[@] identifier[BackpressureSupport] operator[SEP] identifier[BackpressureKind] operator[SEP] identifier[FULL] operator[SEP] annotation[@] identifier[CheckReturnValue] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Flowable] operator[<] identifier[T] operator[>] identifier[concatArrayEager] operator[SEP] identifier[MaybeSource] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[...] identifier[sources] operator[SEP] {
Keyword[return] identifier[Flowable] operator[SEP] identifier[fromArray] operator[SEP] identifier[sources] operator[SEP] operator[SEP] identifier[concatMapEager] operator[SEP] operator[SEP] identifier[Function] operator[SEP] identifier[MaybeToPublisher] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setPosition(int newIndex) {
if (index != newIndex) {
if (index == -1 || index > newIndex) {
pos = 0;
index = 0;
} else {
index++;
if (length != NULL_LENGTH) {
pos += length;
}
}
for (; index <= newIndex; index++) {
if (index != newIndex) {
int type = this.buf[this.pos++] & 0xff;
switch (type) {
case 251:
break;
case 252:
pos += 2 + (0xffff & (((buf[pos] & 0xff) + ((buf[pos + 1] & 0xff) << 8))));
break;
case 253:
pos += 3 + (0xffffff & ((buf[pos] & 0xff)
+ ((buf[pos + 1] & 0xff) << 8)
+ ((buf[pos + 2] & 0xff) << 16)));
break;
case 254:
pos += 8 + ((buf[pos] & 0xff)
+ ((long) (buf[pos + 1] & 0xff) << 8)
+ ((long) (buf[pos + 2] & 0xff) << 16)
+ ((long) (buf[pos + 3] & 0xff) << 24)
+ ((long) (buf[pos + 4] & 0xff) << 32)
+ ((long) (buf[pos + 5] & 0xff) << 40)
+ ((long) (buf[pos + 6] & 0xff) << 48)
+ ((long) (buf[pos + 7] & 0xff) << 56));
break;
default:
pos += type;
break;
}
} else {
int type = this.buf[this.pos++] & 0xff;
switch (type) {
case 251:
length = NULL_LENGTH;
this.lastValueNull = BIT_LAST_FIELD_NULL;
return;
case 252:
length = 0xffff & ((buf[pos++] & 0xff)
+ ((buf[pos++] & 0xff) << 8));
break;
case 253:
length = 0xffffff & ((buf[pos++] & 0xff)
+ ((buf[pos++] & 0xff) << 8)
+ ((buf[pos++] & 0xff) << 16));
break;
case 254:
length = (int) ((buf[pos++] & 0xff)
+ ((long) (buf[pos++] & 0xff) << 8)
+ ((long) (buf[pos++] & 0xff) << 16)
+ ((long) (buf[pos++] & 0xff) << 24)
+ ((long) (buf[pos++] & 0xff) << 32)
+ ((long) (buf[pos++] & 0xff) << 40)
+ ((long) (buf[pos++] & 0xff) << 48)
+ ((long) (buf[pos++] & 0xff) << 56));
break;
default:
length = type;
break;
}
this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
return;
}
}
}
this.lastValueNull = length == NULL_LENGTH ? BIT_LAST_FIELD_NULL : BIT_LAST_FIELD_NOT_NULL;
}
|
class class_name[name] begin[{]
method[setPosition, return_type[void], modifier[public], parameter[newIndex]] begin[{]
if[binary_operation[member[.index], !=, member[.newIndex]]] begin[{]
if[binary_operation[binary_operation[member[.index], ==, literal[1]], ||, binary_operation[member[.index], >, member[.newIndex]]]] begin[{]
assign[member[.pos], literal[0]]
assign[member[.index], literal[0]]
else begin[{]
member[.index]
if[binary_operation[member[.length], !=, member[.NULL_LENGTH]]] begin[{]
assign[member[.pos], member[.length]]
else begin[{]
None
end[}]
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=newIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=buf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=This(postfix_operators=['++'], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=pos, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=251)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=NULL_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=lastValueNull, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=BIT_LAST_FIELD_NULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=252)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffff), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=+), operator=&)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=253)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffffff), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=<<), operator=+), operator=&)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=254)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=40), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=48), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=56), operator=<<), operator=+), type=BasicType(dimensions=[], name=int))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=lastValueNull, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=BIT_LAST_FIELD_NOT_NULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ReturnStatement(expression=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=buf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=This(postfix_operators=['++'], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=pos, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=251)], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=252)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffff), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=+), operator=&), operator=+)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=253)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffffff), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=<<), operator=+), operator=&), operator=+)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=254)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=40), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=48), operator=<<), operator=+), operandr=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=long)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=56), operator=<<), operator=+), operator=+)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=newIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=None, update=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
assign[THIS[member[None.lastValueNull]], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NULL_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MemberReference(member=BIT_LAST_FIELD_NOT_NULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=BIT_LAST_FIELD_NULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setPosition] operator[SEP] Keyword[int] identifier[newIndex] operator[SEP] {
Keyword[if] operator[SEP] identifier[index] operator[!=] identifier[newIndex] operator[SEP] {
Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[||] identifier[index] operator[>] identifier[newIndex] operator[SEP] {
identifier[pos] operator[=] Other[0] operator[SEP] identifier[index] operator[=] Other[0] operator[SEP]
}
Keyword[else] {
identifier[index] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[!=] identifier[NULL_LENGTH] operator[SEP] {
identifier[pos] operator[+=] identifier[length] operator[SEP]
}
}
Keyword[for] operator[SEP] operator[SEP] identifier[index] operator[<=] identifier[newIndex] operator[SEP] identifier[index] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[index] operator[!=] identifier[newIndex] operator[SEP] {
Keyword[int] identifier[type] operator[=] Keyword[this] operator[SEP] identifier[buf] operator[SEP] Keyword[this] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[switch] operator[SEP] identifier[type] operator[SEP] {
Keyword[case] Other[251] operator[:] Keyword[break] operator[SEP] Keyword[case] Other[252] operator[:] identifier[pos] operator[+=] Other[2] operator[+] operator[SEP] literal[Integer] operator[&] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[+] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[253] operator[:] identifier[pos] operator[+=] Other[3] operator[+] operator[SEP] literal[Integer] operator[&] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[+] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[+] Other[2] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[254] operator[:] identifier[pos] operator[+=] Other[8] operator[+] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[+] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[+] Other[2] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[+] Other[3] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[24] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[+] Other[4] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[32] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[+] Other[5] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[40] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[+] Other[6] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[48] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[+] Other[7] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[56] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[pos] operator[+=] identifier[type] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[else] {
Keyword[int] identifier[type] operator[=] Keyword[this] operator[SEP] identifier[buf] operator[SEP] Keyword[this] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[switch] operator[SEP] identifier[type] operator[SEP] {
Keyword[case] Other[251] operator[:] identifier[length] operator[=] identifier[NULL_LENGTH] operator[SEP] Keyword[this] operator[SEP] identifier[lastValueNull] operator[=] identifier[BIT_LAST_FIELD_NULL] operator[SEP] Keyword[return] operator[SEP] Keyword[case] Other[252] operator[:] identifier[length] operator[=] literal[Integer] operator[&] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[253] operator[:] identifier[length] operator[=] literal[Integer] operator[&] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[254] operator[:] identifier[length] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[24] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[32] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[40] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[48] operator[SEP] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[56] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[length] operator[=] identifier[type] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[this] operator[SEP] identifier[lastValueNull] operator[=] identifier[BIT_LAST_FIELD_NOT_NULL] operator[SEP] Keyword[return] operator[SEP]
}
}
}
Keyword[this] operator[SEP] identifier[lastValueNull] operator[=] identifier[length] operator[==] identifier[NULL_LENGTH] operator[?] identifier[BIT_LAST_FIELD_NULL] operator[:] identifier[BIT_LAST_FIELD_NOT_NULL] operator[SEP]
}
|
public static AsyncWork<XMLDocument, Exception> create(XMLStreamEventsAsync stream) {
XMLDocument doc = new XMLDocument();
AsyncWork<XMLDocument, Exception> result = new AsyncWork<>();
create(doc, stream, result, new SynchronizationPoint<>(true));
return result;
}
|
class class_name[name] begin[{]
method[create, return_type[type[AsyncWork]], modifier[public static], parameter[stream]] begin[{]
local_variable[type[XMLDocument], doc]
local_variable[type[AsyncWork], result]
call[.create, parameter[member[.doc], member[.stream], member[.result], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=SynchronizationPoint, sub_type=None))]]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[AsyncWork] operator[<] identifier[XMLDocument] , identifier[Exception] operator[>] identifier[create] operator[SEP] identifier[XMLStreamEventsAsync] identifier[stream] operator[SEP] {
identifier[XMLDocument] identifier[doc] operator[=] Keyword[new] identifier[XMLDocument] operator[SEP] operator[SEP] operator[SEP] identifier[AsyncWork] operator[<] identifier[XMLDocument] , identifier[Exception] operator[>] identifier[result] operator[=] Keyword[new] identifier[AsyncWork] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[doc] , identifier[stream] , identifier[result] , Keyword[new] identifier[SynchronizationPoint] operator[<] operator[>] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.