code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
|---|---|---|
public static int getKeyLength(String cipherSuite) {
// Roughly ordered from most common to least common.
if (cipherSuite == null) {
return 0;
} else if (cipherSuite.contains("WITH_AES_256_")) {
return 256;
} else if (cipherSuite.contains("WITH_RC4_128_")) {
return 128;
} else if (cipherSuite.contains("WITH_AES_128_")) {
return 128;
} else if (cipherSuite.contains("WITH_RC4_40_")) {
return 40;
} else if (cipherSuite.contains("WITH_3DES_EDE_CBC_")) {
return 168;
} else if (cipherSuite.contains("WITH_IDEA_CBC_")) {
return 128;
} else if (cipherSuite.contains("WITH_RC2_CBC_40_")) {
return 40;
} else if (cipherSuite.contains("WITH_DES40_CBC_")) {
return 40;
} else if (cipherSuite.contains("WITH_DES_CBC_")) {
return 56;
} else {
return 0;
}
}
|
class class_name[name] begin[{]
method[getKeyLength, return_type[type[int]], modifier[public static], parameter[cipherSuite]] begin[{]
if[binary_operation[member[.cipherSuite], ==, literal[null]]] begin[{]
return[literal[0]]
else begin[{]
if[call[cipherSuite.contains, parameter[literal["WITH_AES_256_"]]]] begin[{]
return[literal[256]]
else begin[{]
if[call[cipherSuite.contains, parameter[literal["WITH_RC4_128_"]]]] begin[{]
return[literal[128]]
else begin[{]
if[call[cipherSuite.contains, parameter[literal["WITH_AES_128_"]]]] begin[{]
return[literal[128]]
else begin[{]
if[call[cipherSuite.contains, parameter[literal["WITH_RC4_40_"]]]] begin[{]
return[literal[40]]
else begin[{]
if[call[cipherSuite.contains, parameter[literal["WITH_3DES_EDE_CBC_"]]]] begin[{]
return[literal[168]]
else begin[{]
if[call[cipherSuite.contains, parameter[literal["WITH_IDEA_CBC_"]]]] begin[{]
return[literal[128]]
else begin[{]
if[call[cipherSuite.contains, parameter[literal["WITH_RC2_CBC_40_"]]]] begin[{]
return[literal[40]]
else begin[{]
if[call[cipherSuite.contains, parameter[literal["WITH_DES40_CBC_"]]]] begin[{]
return[literal[40]]
else begin[{]
if[call[cipherSuite.contains, parameter[literal["WITH_DES_CBC_"]]]] begin[{]
return[literal[56]]
else begin[{]
return[literal[0]]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[int] identifier[getKeyLength] operator[SEP] identifier[String] identifier[cipherSuite] operator[SEP] {
Keyword[if] operator[SEP] identifier[cipherSuite] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cipherSuite] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[256] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cipherSuite] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[128] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cipherSuite] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[128] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cipherSuite] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[40] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cipherSuite] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[168] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cipherSuite] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[128] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cipherSuite] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[40] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cipherSuite] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[40] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cipherSuite] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[56] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[0] operator[SEP]
}
}
|
public static responderglobal_responderpolicy_binding[] get_filtered(nitro_service service, String filter) throws Exception{
responderglobal_responderpolicy_binding obj = new responderglobal_responderpolicy_binding();
options option = new options();
option.set_filter(filter);
responderglobal_responderpolicy_binding[] response = (responderglobal_responderpolicy_binding[]) obj.getfiltered(service, option);
return response;
}
|
class class_name[name] begin[{]
method[get_filtered, return_type[type[responderglobal_responderpolicy_binding]], modifier[public static], parameter[service, filter]] begin[{]
local_variable[type[responderglobal_responderpolicy_binding], obj]
local_variable[type[options], option]
call[option.set_filter, parameter[member[.filter]]]
local_variable[type[responderglobal_responderpolicy_binding], response]
return[member[.response]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[responderglobal_responderpolicy_binding] operator[SEP] operator[SEP] identifier[get_filtered] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[filter] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[responderglobal_responderpolicy_binding] identifier[obj] operator[=] Keyword[new] identifier[responderglobal_responderpolicy_binding] operator[SEP] operator[SEP] operator[SEP] identifier[options] identifier[option] operator[=] Keyword[new] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[set_filter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[responderglobal_responderpolicy_binding] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[responderglobal_responderpolicy_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[getfiltered] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
public String encodedPath() {
int pathStart = url.indexOf('/', scheme.length() + 3); // "://".length() == 3.
int pathEnd = delimiterOffset(url, pathStart, url.length(), "?#");
return url.substring(pathStart, pathEnd);
}
|
class class_name[name] begin[{]
method[encodedPath, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[int], pathStart]
local_variable[type[int], pathEnd]
return[call[url.substring, parameter[member[.pathStart], member[.pathEnd]]]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[encodedPath] operator[SEP] operator[SEP] {
Keyword[int] identifier[pathStart] operator[=] identifier[url] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[scheme] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[3] operator[SEP] operator[SEP] Keyword[int] identifier[pathEnd] operator[=] identifier[delimiterOffset] operator[SEP] identifier[url] , identifier[pathStart] , identifier[url] operator[SEP] identifier[length] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[url] operator[SEP] identifier[substring] operator[SEP] identifier[pathStart] , identifier[pathEnd] operator[SEP] operator[SEP]
}
|
protected static Map<String, UnicodeSet> createUnicodeSets() {
final Map<String, UnicodeSet> unicodeSets = new TreeMap<>();
unicodeSets.put("Latin, ASCII", new UnicodeSet("[:ASCII:]"));
unicodeSets.put("Latin, non-ASCII", subUnicodeSet("[:Latin:]", "[:ASCII:]"));
unicodeSets.put("Arabic", new UnicodeSet("[:Script=Arabic:]"));
unicodeSets.put("Armenian", new UnicodeSet("[:Script=Armenian:]"));
unicodeSets.put("Bengali", new UnicodeSet("[:Script=Bengali:]"));
unicodeSets.put("Cyrillic", new UnicodeSet("[:Script=Cyrillic:]"));
unicodeSets.put("Devanagari", new UnicodeSet("[:Script=Devanagari:]"));
unicodeSets.put("Greek", new UnicodeSet("[:Script=Greek:]"));
unicodeSets.put("Han", new UnicodeSet("[:Script=Han:]"));
unicodeSets.put("Gujarati", new UnicodeSet("[:Script=Gujarati:]"));
unicodeSets.put("Georgian", new UnicodeSet("[:Script=Georgian:]"));
unicodeSets.put("Gurmukhi", new UnicodeSet("[:Script=Gurmukhi:]"));
unicodeSets.put("Hangul", new UnicodeSet("[:Script=Hangul:]"));
unicodeSets.put("Hebrew", new UnicodeSet("[:Script=Hebrew:]"));
unicodeSets.put("Hiragana", new UnicodeSet("[:Script=Hiragana:]"));
// unicodeSets.put("Kanji", new UnicodeSet("[:Script=Kanji:]"));
unicodeSets.put("Kannada", new UnicodeSet("[:Script=Kannada:]"));
unicodeSets.put("Katakana", new UnicodeSet("[:Script=Katakana:]"));
unicodeSets.put("Malayalam", new UnicodeSet("[:Script=Malayalam:]"));
// unicodeSets.put("Mandarin", new UnicodeSet("[:Script=Mandarin:]"));
unicodeSets.put("Oriya", new UnicodeSet("[:Script=Oriya:]"));
unicodeSets.put("Syriac", new UnicodeSet("[:Script=Syriac:]"));
unicodeSets.put("Tamil", new UnicodeSet("[:Script=Tamil:]"));
unicodeSets.put("Telugu", new UnicodeSet("[:Script=Telugu:]"));
unicodeSets.put("Thaana", new UnicodeSet("[:Script=Thaana:]"));
unicodeSets.put("Thai", new UnicodeSet("[:Script=Thai:]"));
return unicodeSets;
}
|
class class_name[name] begin[{]
method[createUnicodeSets, return_type[type[Map]], modifier[static protected], parameter[]] begin[{]
local_variable[type[Map], unicodeSets]
call[unicodeSets.put, parameter[literal["Latin, ASCII"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:ASCII:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Latin, non-ASCII"], call[.subUnicodeSet, parameter[literal["[:Latin:]"], literal["[:ASCII:]"]]]]]
call[unicodeSets.put, parameter[literal["Arabic"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Arabic:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Armenian"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Armenian:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Bengali"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Bengali:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Cyrillic"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Cyrillic:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Devanagari"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Devanagari:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Greek"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Greek:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Han"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Han:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Gujarati"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Gujarati:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Georgian"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Georgian:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Gurmukhi"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Gurmukhi:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Hangul"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Hangul:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Hebrew"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Hebrew:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Hiragana"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Hiragana:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Kannada"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Kannada:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Katakana"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Katakana:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Malayalam"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Malayalam:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Oriya"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Oriya:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Syriac"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Syriac:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Tamil"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Tamil:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Telugu"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Telugu:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Thaana"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Thaana:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
call[unicodeSets.put, parameter[literal["Thai"], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[:Script=Thai:]")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnicodeSet, sub_type=None))]]
return[member[.unicodeSets]]
end[}]
END[}]
|
Keyword[protected] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[UnicodeSet] operator[>] identifier[createUnicodeSets] operator[SEP] operator[SEP] {
Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[UnicodeSet] operator[>] identifier[unicodeSets] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[subUnicodeSet] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[unicodeSets] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[UnicodeSet] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[unicodeSets] operator[SEP]
}
|
@PrivateApi
public static ExceptionHandler logAllExceptions(final ILogger logger, final Level level) {
if (logger.isLoggable(level)) {
return new ExceptionHandler() {
@Override
public void handleException(Throwable throwable) {
logger.log(level, "Exception occurred", throwable);
}
};
}
return IGNORE_ALL_EXCEPTIONS;
}
|
class class_name[name] begin[{]
method[logAllExceptions, return_type[type[ExceptionHandler]], modifier[public static], parameter[logger, level]] begin[{]
if[call[logger.isLoggable, parameter[member[.level]]]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception occurred"), MemberReference(member=throwable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=handleException, parameters=[FormalParameter(annotations=[], modifiers=set(), name=throwable, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, 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=ExceptionHandler, sub_type=None))]
else begin[{]
None
end[}]
return[member[.IGNORE_ALL_EXCEPTIONS]]
end[}]
END[}]
|
annotation[@] identifier[PrivateApi] Keyword[public] Keyword[static] identifier[ExceptionHandler] identifier[logAllExceptions] operator[SEP] Keyword[final] identifier[ILogger] identifier[logger] , Keyword[final] identifier[Level] identifier[level] operator[SEP] {
Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[level] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[ExceptionHandler] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handleException] operator[SEP] identifier[Throwable] identifier[throwable] operator[SEP] {
identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[level] , literal[String] , identifier[throwable] operator[SEP] operator[SEP]
}
} operator[SEP]
}
Keyword[return] identifier[IGNORE_ALL_EXCEPTIONS] operator[SEP]
}
|
public static Class<?> getTypeArgument(Class<?> clazz, Class<?> interfce) {
Map<Type, Type> resolvedTypes = new HashMap<Type, Type>();
Type type = clazz;
while (!declaresInterface(getClass(type), interfce)) {
if (type instanceof Class) {
type = ((Class<?>) type).getGenericSuperclass();
} else {
ParameterizedType parameterizedType = (ParameterizedType) type;
Class<?> rawType = (Class<?>) parameterizedType.getRawType();
Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
TypeVariable<?>[] typeParameters = rawType.getTypeParameters();
for (int i = 0; i < actualTypeArguments.length; i++) {
resolvedTypes.put(typeParameters[i], actualTypeArguments[i]);
}
type = rawType.getGenericSuperclass();
}
}
Type actualTypeArgument;
if (type instanceof Class) {
actualTypeArgument = ((Class<?>) type).getTypeParameters()[0];
} else {
actualTypeArgument = ((ParameterizedType) type).getActualTypeArguments()[0];
}
Class<?> typeArgumentAsClass = null;
while (resolvedTypes.containsKey(actualTypeArgument)) {
actualTypeArgument = resolvedTypes.get(actualTypeArgument);
}
typeArgumentAsClass = getClass(actualTypeArgument);
return typeArgumentAsClass;
}
|
class class_name[name] begin[{]
method[getTypeArgument, return_type[type[Class]], modifier[public static], parameter[clazz, interfce]] begin[{]
local_variable[type[Map], resolvedTypes]
local_variable[type[Type], type]
while[call[.declaresInterface, parameter[call[.getClass, parameter[member[.type]]], member[.interfce]]]] begin[{]
if[binary_operation[member[.type], instanceof, type[Class]]] begin[{]
assign[member[.type], Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))]
else begin[{]
local_variable[type[ParameterizedType], parameterizedType]
local_variable[type[Class], rawType]
local_variable[type[Type], actualTypeArguments]
local_variable[type[TypeVariable], typeParameters]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=typeParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=actualTypeArguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=put, postfix_operators=[], prefix_operators=[], qualifier=resolvedTypes, 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=actualTypeArguments, 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)
assign[member[.type], call[rawType.getGenericSuperclass, parameter[]]]
end[}]
end[}]
local_variable[type[Type], actualTypeArgument]
if[binary_operation[member[.type], instanceof, type[Class]]] begin[{]
assign[member[.actualTypeArgument], Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))]
else begin[{]
assign[member[.actualTypeArgument], Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None))]
end[}]
local_variable[type[Class], typeArgumentAsClass]
while[call[resolvedTypes.containsKey, parameter[member[.actualTypeArgument]]]] begin[{]
assign[member[.actualTypeArgument], call[resolvedTypes.get, parameter[member[.actualTypeArgument]]]]
end[}]
assign[member[.typeArgumentAsClass], call[.getClass, parameter[member[.actualTypeArgument]]]]
return[member[.typeArgumentAsClass]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] identifier[getTypeArgument] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[Class] operator[<] operator[?] operator[>] identifier[interfce] operator[SEP] {
identifier[Map] operator[<] identifier[Type] , identifier[Type] operator[>] identifier[resolvedTypes] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Type] , identifier[Type] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Type] identifier[type] operator[=] identifier[clazz] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[declaresInterface] operator[SEP] identifier[getClass] operator[SEP] identifier[type] operator[SEP] , identifier[interfce] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[Class] operator[SEP] {
identifier[type] operator[=] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getGenericSuperclass] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ParameterizedType] identifier[parameterizedType] operator[=] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[type] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[rawType] operator[=] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[parameterizedType] operator[SEP] identifier[getRawType] operator[SEP] operator[SEP] operator[SEP] identifier[Type] operator[SEP] operator[SEP] identifier[actualTypeArguments] operator[=] identifier[parameterizedType] operator[SEP] identifier[getActualTypeArguments] operator[SEP] operator[SEP] operator[SEP] identifier[TypeVariable] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[typeParameters] operator[=] identifier[rawType] operator[SEP] identifier[getTypeParameters] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[actualTypeArguments] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[resolvedTypes] operator[SEP] identifier[put] operator[SEP] identifier[typeParameters] operator[SEP] identifier[i] operator[SEP] , identifier[actualTypeArguments] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
identifier[type] operator[=] identifier[rawType] operator[SEP] identifier[getGenericSuperclass] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[Type] identifier[actualTypeArgument] operator[SEP] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[Class] operator[SEP] {
identifier[actualTypeArgument] operator[=] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getTypeParameters] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[actualTypeArgument] operator[=] operator[SEP] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getActualTypeArguments] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
identifier[Class] operator[<] operator[?] operator[>] identifier[typeArgumentAsClass] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[resolvedTypes] operator[SEP] identifier[containsKey] operator[SEP] identifier[actualTypeArgument] operator[SEP] operator[SEP] {
identifier[actualTypeArgument] operator[=] identifier[resolvedTypes] operator[SEP] identifier[get] operator[SEP] identifier[actualTypeArgument] operator[SEP] operator[SEP]
}
identifier[typeArgumentAsClass] operator[=] identifier[getClass] operator[SEP] identifier[actualTypeArgument] operator[SEP] operator[SEP] Keyword[return] identifier[typeArgumentAsClass] operator[SEP]
}
|
public final boolean isModified (String fieldName)
{
Integer index = _descripMap.get(fieldName);
if (index == null) {
throw new IllegalArgumentException("Field not in mask: " + fieldName);
}
return _modified[index.intValue()];
}
|
class class_name[name] begin[{]
method[isModified, return_type[type[boolean]], modifier[final public], parameter[fieldName]] begin[{]
local_variable[type[Integer], index]
if[binary_operation[member[.index], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Field not in mask: "), operandr=MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[._modified]]
end[}]
END[}]
|
Keyword[public] Keyword[final] Keyword[boolean] identifier[isModified] operator[SEP] identifier[String] identifier[fieldName] operator[SEP] {
identifier[Integer] identifier[index] operator[=] identifier[_descripMap] operator[SEP] identifier[get] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[fieldName] operator[SEP] operator[SEP]
}
Keyword[return] identifier[_modified] operator[SEP] identifier[index] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void writeFile(String aFileName, String aData) throws IOException
{
Object lock = retrieveLock(aFileName);
synchronized (lock)
{
IO.writeFile(aFileName, aData,IO.CHARSET);
}
}
|
class class_name[name] begin[{]
method[writeFile, return_type[void], modifier[public], parameter[aFileName, aData]] begin[{]
local_variable[type[Object], lock]
SYNCHRONIZED[member[.lock]] BEGIN[{]
call[IO.writeFile, parameter[member[.aFileName], member[.aData], member[IO.CHARSET]]]
END[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[writeFile] operator[SEP] identifier[String] identifier[aFileName] , identifier[String] identifier[aData] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Object] identifier[lock] operator[=] identifier[retrieveLock] operator[SEP] identifier[aFileName] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] {
identifier[IO] operator[SEP] identifier[writeFile] operator[SEP] identifier[aFileName] , identifier[aData] , identifier[IO] operator[SEP] identifier[CHARSET] operator[SEP] operator[SEP]
}
}
|
public static long inlined(DMatrixRMaj A , int n ) {
long before = System.currentTimeMillis();
double total = 0;
for( int iter = 0; iter < n; iter++ ) {
for( int i = 0; i < A.numRows; i++ ) {
for( int j = 0; j < A.numCols; j++ ) {
total += A.data[i*A.numCols + j];
}
}
}
long after = System.currentTimeMillis();
// print to ensure that ensure that an overly smart compiler does not optimize out
// the whole function and to show that both produce the same results.
System.out.println(total);
return after-before;
}
|
class class_name[name] begin[{]
method[inlined, return_type[type[long]], modifier[public static], parameter[A, n]] begin[{]
local_variable[type[long], before]
local_variable[type[double], total]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=A, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=A, selectors=[]), operator=*), operandr=MemberReference(member=j, 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=numCols, postfix_operators=[], prefix_operators=[], qualifier=A, 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=numRows, postfix_operators=[], prefix_operators=[], qualifier=A, 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=ForControl(condition=BinaryOperation(operandl=MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, 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=iter)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=iter, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[long], after]
call[System.out.println, parameter[member[.total]]]
return[binary_operation[member[.after], -, member[.before]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[long] identifier[inlined] operator[SEP] identifier[DMatrixRMaj] identifier[A] , Keyword[int] identifier[n] operator[SEP] {
Keyword[long] identifier[before] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[total] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[iter] operator[=] Other[0] operator[SEP] identifier[iter] operator[<] identifier[n] operator[SEP] identifier[iter] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[A] operator[SEP] identifier[numRows] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[A] operator[SEP] identifier[numCols] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[total] operator[+=] identifier[A] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[*] identifier[A] operator[SEP] identifier[numCols] operator[+] identifier[j] operator[SEP] operator[SEP]
}
}
}
Keyword[long] identifier[after] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[total] operator[SEP] operator[SEP] Keyword[return] identifier[after] operator[-] identifier[before] operator[SEP]
}
|
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) {
// Stop controller stopwatch
stopStopwatch();
HandlerLocation location = threadLocation.get();
location.setStep(HandlerStep.VIEW);
// Start view stopwatch
startStopwatch(location);
}
|
class class_name[name] begin[{]
method[postHandle, return_type[void], modifier[public], parameter[request, response, handler, modelAndView]] begin[{]
call[.stopStopwatch, parameter[]]
local_variable[type[HandlerLocation], location]
call[location.setStep, parameter[member[HandlerStep.VIEW]]]
call[.startStopwatch, parameter[member[.location]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[postHandle] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] , identifier[Object] identifier[handler] , identifier[ModelAndView] identifier[modelAndView] operator[SEP] {
identifier[stopStopwatch] operator[SEP] operator[SEP] operator[SEP] identifier[HandlerLocation] identifier[location] operator[=] identifier[threadLocation] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[location] operator[SEP] identifier[setStep] operator[SEP] identifier[HandlerStep] operator[SEP] identifier[VIEW] operator[SEP] operator[SEP] identifier[startStopwatch] operator[SEP] identifier[location] operator[SEP] operator[SEP]
}
|
public String renameResourceInternal(CmsUUID structureId, String newName) throws CmsException {
newName = newName.trim();
CmsObject rootCms = OpenCms.initCmsObject(getCmsObject());
rootCms.getRequestContext().setSiteRoot("");
Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(rootCms);
try {
CmsResource.checkResourceName(newName);
} catch (CmsIllegalArgumentException e) {
return e.getLocalizedMessage(locale);
}
CmsResource resource = rootCms.readResource(structureId, CmsResourceFilter.IGNORE_EXPIRATION);
String oldPath = resource.getRootPath();
String parentPath = CmsResource.getParentFolder(oldPath);
String newPath = CmsStringUtil.joinPaths(parentPath, newName);
try {
ensureLock(resource);
rootCms.moveResource(oldPath, newPath);
resource = rootCms.readResource(structureId, CmsResourceFilter.IGNORE_EXPIRATION);
} catch (CmsException e) {
return e.getLocalizedMessage(OpenCms.getWorkplaceManager().getWorkplaceLocale(rootCms));
}
tryUnlock(resource);
return null;
}
|
class class_name[name] begin[{]
method[renameResourceInternal, return_type[type[String]], modifier[public], parameter[structureId, newName]] begin[{]
assign[member[.newName], call[newName.trim, parameter[]]]
local_variable[type[CmsObject], rootCms]
call[rootCms.getRequestContext, parameter[]]
local_variable[type[Locale], locale]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkResourceName, postfix_operators=[], prefix_operators=[], qualifier=CmsResource, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsIllegalArgumentException']))], finally_block=None, label=None, resources=None)
local_variable[type[CmsResource], resource]
local_variable[type[String], oldPath]
local_variable[type[String], parentPath]
local_variable[type[String], newPath]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ensureLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=oldPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=moveResource, postfix_operators=[], prefix_operators=[], qualifier=rootCms, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=structureId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=IGNORE_EXPIRATION, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[])], member=readResource, postfix_operators=[], prefix_operators=[], qualifier=rootCms, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWorkplaceManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=rootCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWorkplaceLocale, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)
call[.tryUnlock, parameter[member[.resource]]]
return[literal[null]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[renameResourceInternal] operator[SEP] identifier[CmsUUID] identifier[structureId] , identifier[String] identifier[newName] operator[SEP] Keyword[throws] identifier[CmsException] {
identifier[newName] operator[=] identifier[newName] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[CmsObject] identifier[rootCms] operator[=] identifier[OpenCms] operator[SEP] identifier[initCmsObject] operator[SEP] identifier[getCmsObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[rootCms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[setSiteRoot] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Locale] identifier[locale] operator[=] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getWorkplaceLocale] operator[SEP] identifier[rootCms] operator[SEP] operator[SEP] Keyword[try] {
identifier[CmsResource] operator[SEP] identifier[checkResourceName] operator[SEP] identifier[newName] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsIllegalArgumentException] identifier[e] operator[SEP] {
Keyword[return] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] identifier[locale] operator[SEP] operator[SEP]
}
identifier[CmsResource] identifier[resource] operator[=] identifier[rootCms] operator[SEP] identifier[readResource] operator[SEP] identifier[structureId] , identifier[CmsResourceFilter] operator[SEP] identifier[IGNORE_EXPIRATION] operator[SEP] operator[SEP] identifier[String] identifier[oldPath] operator[=] identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[parentPath] operator[=] identifier[CmsResource] operator[SEP] identifier[getParentFolder] operator[SEP] identifier[oldPath] operator[SEP] operator[SEP] identifier[String] identifier[newPath] operator[=] identifier[CmsStringUtil] operator[SEP] identifier[joinPaths] operator[SEP] identifier[parentPath] , identifier[newName] operator[SEP] operator[SEP] Keyword[try] {
identifier[ensureLock] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[rootCms] operator[SEP] identifier[moveResource] operator[SEP] identifier[oldPath] , identifier[newPath] operator[SEP] operator[SEP] identifier[resource] operator[=] identifier[rootCms] operator[SEP] identifier[readResource] operator[SEP] identifier[structureId] , identifier[CmsResourceFilter] operator[SEP] identifier[IGNORE_EXPIRATION] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
Keyword[return] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getWorkplaceLocale] operator[SEP] identifier[rootCms] operator[SEP] operator[SEP] operator[SEP]
}
identifier[tryUnlock] operator[SEP] identifier[resource] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public static SQLException mapSQLException(SQLException se, Object mapper) {
return (SQLException) mapException(se, null, mapper, true);
}
|
class class_name[name] begin[{]
method[mapSQLException, return_type[type[SQLException]], modifier[public static], parameter[se, mapper]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=mapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=mapException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SQLException, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[SQLException] identifier[mapSQLException] operator[SEP] identifier[SQLException] identifier[se] , identifier[Object] identifier[mapper] operator[SEP] {
Keyword[return] operator[SEP] identifier[SQLException] operator[SEP] identifier[mapException] operator[SEP] identifier[se] , Other[null] , identifier[mapper] , literal[boolean] operator[SEP] operator[SEP]
}
|
@Override
public GetDiskResult getDisk(GetDiskRequest request) {
request = beforeClientExecution(request);
return executeGetDisk(request);
}
|
class class_name[name] begin[{]
method[getDisk, return_type[type[GetDiskResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeGetDisk, parameter[member[.request]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[GetDiskResult] identifier[getDisk] operator[SEP] identifier[GetDiskRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetDisk] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static vpnglobal_domain_binding[] get_filtered(nitro_service service, String filter) throws Exception{
vpnglobal_domain_binding obj = new vpnglobal_domain_binding();
options option = new options();
option.set_filter(filter);
vpnglobal_domain_binding[] response = (vpnglobal_domain_binding[]) obj.getfiltered(service, option);
return response;
}
|
class class_name[name] begin[{]
method[get_filtered, return_type[type[vpnglobal_domain_binding]], modifier[public static], parameter[service, filter]] begin[{]
local_variable[type[vpnglobal_domain_binding], obj]
local_variable[type[options], option]
call[option.set_filter, parameter[member[.filter]]]
local_variable[type[vpnglobal_domain_binding], response]
return[member[.response]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[vpnglobal_domain_binding] operator[SEP] operator[SEP] identifier[get_filtered] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[filter] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[vpnglobal_domain_binding] identifier[obj] operator[=] Keyword[new] identifier[vpnglobal_domain_binding] operator[SEP] operator[SEP] operator[SEP] identifier[options] identifier[option] operator[=] Keyword[new] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[set_filter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[vpnglobal_domain_binding] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[vpnglobal_domain_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[getfiltered] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
@Override
public boolean match(Certificate cert) {
if (!(cert instanceof X509Certificate)) {
return false;
}
X509Certificate xcert = (X509Certificate)cert;
int version = xcert.getVersion();
// Check the validity period for version 1 and 2 certificate.
if (version < 3) {
if (startDate != null) {
try {
xcert.checkValidity(startDate);
} catch (CertificateException ce) {
return false;
}
}
if (endDate != null) {
try {
xcert.checkValidity(endDate);
} catch (CertificateException ce) {
return false;
}
}
}
// If no SubjectKeyIdentifier extension, don't bother to check it.
if (isSKIDSensitive &&
(version < 3 || xcert.getExtensionValue("2.5.29.14") == null)) {
setSubjectKeyIdentifier(null);
}
// In practice, a CA may replace its root certificate and require that
// the existing certificate is still valid, even if the AKID extension
// does not match the replacement root certificate fields.
//
// Conservatively, we only support the replacement for version 1 and
// version 2 certificate. As for version 2, the certificate extension
// may contain sensitive information (for example, policies), the
// AKID need to be respected to seek the exact certificate in case
// of key or certificate abuse.
if (isSNSensitive && version < 3) {
setSerialNumber(null);
}
return super.match(cert);
}
|
class class_name[name] begin[{]
method[match, return_type[type[boolean]], modifier[public], parameter[cert]] begin[{]
if[binary_operation[member[.cert], instanceof, type[X509Certificate]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[X509Certificate], xcert]
local_variable[type[int], version]
if[binary_operation[member[.version], <, literal[3]]] begin[{]
if[binary_operation[member[.startDate], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=startDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkValidity, postfix_operators=[], prefix_operators=[], qualifier=xcert, selectors=[], type_arguments=None), 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=ce, types=['CertificateException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
if[binary_operation[member[.endDate], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=endDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkValidity, postfix_operators=[], prefix_operators=[], qualifier=xcert, selectors=[], type_arguments=None), 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=ce, types=['CertificateException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.isSKIDSensitive], &&, binary_operation[binary_operation[member[.version], <, literal[3]], ||, binary_operation[call[xcert.getExtensionValue, parameter[literal["2.5.29.14"]]], ==, literal[null]]]]] begin[{]
call[.setSubjectKeyIdentifier, parameter[literal[null]]]
else begin[{]
None
end[}]
if[binary_operation[member[.isSNSensitive], &&, binary_operation[member[.version], <, literal[3]]]] begin[{]
call[.setSerialNumber, parameter[literal[null]]]
else begin[{]
None
end[}]
return[SuperMethodInvocation(arguments=[MemberReference(member=cert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[match] operator[SEP] identifier[Certificate] identifier[cert] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[cert] Keyword[instanceof] identifier[X509Certificate] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[X509Certificate] identifier[xcert] operator[=] operator[SEP] identifier[X509Certificate] operator[SEP] identifier[cert] operator[SEP] Keyword[int] identifier[version] operator[=] identifier[xcert] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[version] operator[<] Other[3] operator[SEP] {
Keyword[if] operator[SEP] identifier[startDate] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[xcert] operator[SEP] identifier[checkValidity] operator[SEP] identifier[startDate] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CertificateException] identifier[ce] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[endDate] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[xcert] operator[SEP] identifier[checkValidity] operator[SEP] identifier[endDate] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CertificateException] identifier[ce] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[isSKIDSensitive] operator[&&] operator[SEP] identifier[version] operator[<] Other[3] operator[||] identifier[xcert] operator[SEP] identifier[getExtensionValue] operator[SEP] literal[String] operator[SEP] operator[==] Other[null] operator[SEP] operator[SEP] {
identifier[setSubjectKeyIdentifier] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isSNSensitive] operator[&&] identifier[version] operator[<] Other[3] operator[SEP] {
identifier[setSerialNumber] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[match] operator[SEP] identifier[cert] operator[SEP] operator[SEP]
}
|
private static int toInteger(CharSequence seq) {
int len = seq.length();
int n = 0;
int i = 0;
while (i < len) {
char c = seq.charAt(i);
if (c >= '0' && c <= '9') {
n *= 10;
n += (int)(c - '0');
} else {
break;
}
i++;
}
return n;
}
|
class class_name[name] begin[{]
method[toInteger, return_type[type[int]], modifier[private static], parameter[seq]] begin[{]
local_variable[type[int], len]
local_variable[type[int], n]
local_variable[type[int], i]
while[binary_operation[member[.i], <, member[.len]]] begin[{]
local_variable[type[char], c]
if[binary_operation[binary_operation[member[.c], >=, literal['0']], &&, binary_operation[member[.c], <=, literal['9']]]] begin[{]
assign[member[.n], literal[10]]
assign[member[.n], Cast(expression=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=-), type=BasicType(dimensions=[], name=int))]
else begin[{]
BreakStatement(goto=None, label=None)
end[}]
member[.i]
end[}]
return[member[.n]]
end[}]
END[}]
|
Keyword[private] Keyword[static] Keyword[int] identifier[toInteger] operator[SEP] identifier[CharSequence] identifier[seq] operator[SEP] {
Keyword[int] identifier[len] operator[=] identifier[seq] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[=] Other[0] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[seq] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[>=] literal[String] operator[&&] identifier[c] operator[<=] literal[String] operator[SEP] {
identifier[n] operator[*=] Other[10] operator[SEP] identifier[n] operator[+=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[c] operator[-] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[break] operator[SEP]
}
identifier[i] operator[++] operator[SEP]
}
Keyword[return] identifier[n] operator[SEP]
}
|
@NotNull
public static String escapeChar(@NotNull final String string, final char toEscape) {
final String toEscapeStr = String.valueOf(toEscape);
return string.replaceAll("\\\\" + toEscapeStr, toEscapeStr).replaceAll(toEscapeStr, "\\\\" + toEscapeStr);
}
|
class class_name[name] begin[{]
method[escapeChar, return_type[type[String]], modifier[public static], parameter[string, toEscape]] begin[{]
local_variable[type[String], toEscapeStr]
return[call[string.replaceAll, parameter[binary_operation[literal["\\\\"], +, member[.toEscapeStr]], member[.toEscapeStr]]]]
end[}]
END[}]
|
annotation[@] identifier[NotNull] Keyword[public] Keyword[static] identifier[String] identifier[escapeChar] operator[SEP] annotation[@] identifier[NotNull] Keyword[final] identifier[String] identifier[string] , Keyword[final] Keyword[char] identifier[toEscape] operator[SEP] {
Keyword[final] identifier[String] identifier[toEscapeStr] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[toEscape] operator[SEP] operator[SEP] Keyword[return] identifier[string] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] operator[+] identifier[toEscapeStr] , identifier[toEscapeStr] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[toEscapeStr] , literal[String] operator[+] identifier[toEscapeStr] operator[SEP] operator[SEP]
}
|
@Override
protected void startUp() throws Exception {
try {
UserGroupInformation.setConfiguration(_hadoopConf);
if (UserGroupInformation.isSecurityEnabled()) {
UserGroupInformation.loginUserFromKeytab(_loginUser, _loginUserKeytabFile);
}
} catch (Throwable t) {
log.error("Failed to start up HadoopKerberosKeytabAuthenticationPlugin", t);
throw t;
}
}
|
class class_name[name] begin[{]
method[startUp, return_type[void], modifier[protected], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=_hadoopConf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConfiguration, postfix_operators=[], prefix_operators=[], qualifier=UserGroupInformation, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isSecurityEnabled, postfix_operators=[], prefix_operators=[], qualifier=UserGroupInformation, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=_loginUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=_loginUserKeytabFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loginUserFromKeytab, postfix_operators=[], prefix_operators=[], qualifier=UserGroupInformation, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to start up HadoopKerberosKeytabAuthenticationPlugin"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[startUp] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[try] {
identifier[UserGroupInformation] operator[SEP] identifier[setConfiguration] operator[SEP] identifier[_hadoopConf] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[UserGroupInformation] operator[SEP] identifier[isSecurityEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[UserGroupInformation] operator[SEP] identifier[loginUserFromKeytab] operator[SEP] identifier[_loginUser] , identifier[_loginUserKeytabFile] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP] Keyword[throw] identifier[t] operator[SEP]
}
}
|
public InstanceFailoverGroupInner failover(String resourceGroupName, String locationName, String failoverGroupName) {
return failoverWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName).toBlocking().last().body();
}
|
class class_name[name] begin[{]
method[failover, return_type[type[InstanceFailoverGroupInner]], modifier[public], parameter[resourceGroupName, locationName, failoverGroupName]] begin[{]
return[call[.failoverWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.locationName], member[.failoverGroupName]]]]
end[}]
END[}]
|
Keyword[public] identifier[InstanceFailoverGroupInner] identifier[failover] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[locationName] , identifier[String] identifier[failoverGroupName] operator[SEP] {
Keyword[return] identifier[failoverWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[locationName] , identifier[failoverGroupName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[last] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void endElement(final String uri, final String localName, final String qName) throws SAXException {
if (!(DITA_OT_NS.equals(uri) && EXTENSION_ELEM.equals(localName))) {
getContentHandler().endElement(uri, localName, qName);
}
}
|
class class_name[name] begin[{]
method[endElement, return_type[void], modifier[public], parameter[uri, localName, qName]] begin[{]
if[binary_operation[call[DITA_OT_NS.equals, parameter[member[.uri]]], &&, call[EXTENSION_ELEM.equals, parameter[member[.localName]]]]] begin[{]
call[.getContentHandler, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[endElement] operator[SEP] Keyword[final] identifier[String] identifier[uri] , Keyword[final] identifier[String] identifier[localName] , Keyword[final] identifier[String] identifier[qName] operator[SEP] Keyword[throws] identifier[SAXException] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[DITA_OT_NS] operator[SEP] identifier[equals] operator[SEP] identifier[uri] operator[SEP] operator[&&] identifier[EXTENSION_ELEM] operator[SEP] identifier[equals] operator[SEP] identifier[localName] operator[SEP] operator[SEP] operator[SEP] {
identifier[getContentHandler] operator[SEP] operator[SEP] operator[SEP] identifier[endElement] operator[SEP] identifier[uri] , identifier[localName] , identifier[qName] operator[SEP] operator[SEP]
}
}
|
public com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata
getVideoEventDetails() {
if (detailsCase_ == 8) {
return (com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata) details_;
}
return com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata
.getDefaultInstance();
}
|
class class_name[name] begin[{]
method[getVideoEventDetails, return_type[type[com]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.detailsCase_], ==, literal[8]]] begin[{]
return[Cast(expression=MemberReference(member=details_, 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=cloud, sub_type=ReferenceType(arguments=None, dimensions=None, name=datalabeling, sub_type=ReferenceType(arguments=None, dimensions=None, name=v1beta1, sub_type=ReferenceType(arguments=None, dimensions=None, name=LabelVideoEventOperationMetadata, sub_type=None)))))))]
else begin[{]
None
end[}]
return[call[com.google.cloud.datalabeling.v1beta1.LabelVideoEventOperationMetadata.getDefaultInstance, parameter[]]]
end[}]
END[}]
|
Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[cloud] operator[SEP] identifier[datalabeling] operator[SEP] identifier[v1beta1] operator[SEP] identifier[LabelVideoEventOperationMetadata] identifier[getVideoEventDetails] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[detailsCase_] operator[==] Other[8] operator[SEP] {
Keyword[return] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[cloud] operator[SEP] identifier[datalabeling] operator[SEP] identifier[v1beta1] operator[SEP] identifier[LabelVideoEventOperationMetadata] operator[SEP] identifier[details_] operator[SEP]
}
Keyword[return] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[cloud] operator[SEP] identifier[datalabeling] operator[SEP] identifier[v1beta1] operator[SEP] identifier[LabelVideoEventOperationMetadata] operator[SEP] identifier[getDefaultInstance] operator[SEP] operator[SEP] operator[SEP]
}
|
private String[] getContextFolders() {
final StandaloneContext context = new StandaloneContext();
context.setContextFoldersAsCSV(contextFoldersAsCSV);
return context.getContextFolders();
}
|
class class_name[name] begin[{]
method[getContextFolders, return_type[type[String]], modifier[private], parameter[]] begin[{]
local_variable[type[StandaloneContext], context]
call[context.setContextFoldersAsCSV, parameter[member[.contextFoldersAsCSV]]]
return[call[context.getContextFolders, parameter[]]]
end[}]
END[}]
|
Keyword[private] identifier[String] operator[SEP] operator[SEP] identifier[getContextFolders] operator[SEP] operator[SEP] {
Keyword[final] identifier[StandaloneContext] identifier[context] operator[=] Keyword[new] identifier[StandaloneContext] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setContextFoldersAsCSV] operator[SEP] identifier[contextFoldersAsCSV] operator[SEP] operator[SEP] Keyword[return] identifier[context] operator[SEP] identifier[getContextFolders] operator[SEP] operator[SEP] operator[SEP]
}
|
private static <OriginObject, TargetObject> TargetObject setValue(OriginObject originObject, TargetObject targetObject, Class<TargetObject> targetClass) {
Field[] targetFields = ReflectUtil.getFieldArrayIncludeSupClassExcludeUID(targetClass);
Field originField = null; //目标字段类型
Object originValue = null; //原始对象属性值
Object targetValue = null; //目标对象属性值
//从目标对象中找原始对象的属性方式,
for (Field targetField : targetFields) {
originField = ReflectUtil.getField(originObject.getClass(), targetField.getName());
if (originField == null) { //目标对象有,但是原始对象中没有
continue;
}
if (Modifier.isStatic(originField.getModifiers())) {
continue;
}
targetField.setAccessible(true);
originField.setAccessible(true);
originValue = ReflectUtil.getFieldVal(originObject, targetField.getName());
if (originValue == null) { //从原始对象中获取的字段属性为null
continue;
}
targetValue = ValueCast.cast(targetField, targetObject, originValue);
if (targetValue != null) {
try {
targetField.set(targetObject, targetValue);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {//为目标属性赋值失败
e.printStackTrace();
}
}
}
return targetObject;
}
|
class class_name[name] begin[{]
method[setValue, return_type[type[TargetObject]], modifier[private static], parameter[originObject, targetObject, targetClass]] begin[{]
local_variable[type[Field], targetFields]
local_variable[type[Field], originField]
local_variable[type[Object], originValue]
local_variable[type[Object], targetValue]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=originField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=originObject, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=targetField, selectors=[], type_arguments=None)], member=getField, postfix_operators=[], prefix_operators=[], qualifier=ReflectUtil, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=originField, 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=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=originField, selectors=[], type_arguments=None)], member=isStatic, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=targetField, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=originField, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=originValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=originObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=targetField, selectors=[], type_arguments=None)], member=getFieldVal, postfix_operators=[], prefix_operators=[], qualifier=ReflectUtil, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=originValue, 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=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=targetField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=originValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cast, postfix_operators=[], prefix_operators=[], qualifier=ValueCast, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=targetValue, 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=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=targetObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=targetField, 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=['IllegalArgumentException'])), 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=['IllegalAccessException']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=targetFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=targetField)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None)
return[member[.targetObject]]
end[}]
END[}]
|
Keyword[private] Keyword[static] operator[<] identifier[OriginObject] , identifier[TargetObject] operator[>] identifier[TargetObject] identifier[setValue] operator[SEP] identifier[OriginObject] identifier[originObject] , identifier[TargetObject] identifier[targetObject] , identifier[Class] operator[<] identifier[TargetObject] operator[>] identifier[targetClass] operator[SEP] {
identifier[Field] operator[SEP] operator[SEP] identifier[targetFields] operator[=] identifier[ReflectUtil] operator[SEP] identifier[getFieldArrayIncludeSupClassExcludeUID] operator[SEP] identifier[targetClass] operator[SEP] operator[SEP] identifier[Field] identifier[originField] operator[=] Other[null] operator[SEP] identifier[Object] identifier[originValue] operator[=] Other[null] operator[SEP] identifier[Object] identifier[targetValue] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[targetField] operator[:] identifier[targetFields] operator[SEP] {
identifier[originField] operator[=] identifier[ReflectUtil] operator[SEP] identifier[getField] operator[SEP] identifier[originObject] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[targetField] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[originField] operator[==] Other[null] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isStatic] operator[SEP] identifier[originField] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[targetField] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[originField] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[originValue] operator[=] identifier[ReflectUtil] operator[SEP] identifier[getFieldVal] operator[SEP] identifier[originObject] , identifier[targetField] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[originValue] operator[==] Other[null] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[targetValue] operator[=] identifier[ValueCast] operator[SEP] identifier[cast] operator[SEP] identifier[targetField] , identifier[targetObject] , identifier[originValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetValue] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[targetField] operator[SEP] identifier[set] operator[SEP] identifier[targetObject] , identifier[targetValue] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[targetObject] operator[SEP]
}
|
static ImmutableList<ExecutableElement> orderedConstructorsIn(
TypeElement element, List<String> reflectAnnotations) {
List<ExecutableElement> allConstructors =
ElementFilter.constructorsIn(element.getEnclosedElements());
List<ExecutableElement> visibleConstructors = new ArrayList<>(allConstructors.size());
for (ExecutableElement constructor : allConstructors) {
if (Visibility.ofElement(constructor) != Visibility.PRIVATE) {
visibleConstructors.add(constructor);
}
}
Collections.sort(visibleConstructors, PARAMETER_COUNT_ORDER.reverse());
List<ExecutableElement> reflectConstructors = new ArrayList<>();
if (reflectAnnotations.size() > 0) {
for (ExecutableElement constructor : allConstructors) {
if (Visibility.ofElement(constructor) == Visibility.PRIVATE
&& usesAnyAnnotationsFrom(constructor, reflectAnnotations)) {
reflectConstructors.add(constructor);
}
}
Collections.sort(reflectConstructors, PARAMETER_COUNT_ORDER.reverse());
}
return ImmutableList.<ExecutableElement>builder()
.addAll(visibleConstructors)
.addAll(reflectConstructors)
.build();
}
|
class class_name[name] begin[{]
method[orderedConstructorsIn, return_type[type[ImmutableList]], modifier[static], parameter[element, reflectAnnotations]] begin[{]
local_variable[type[List], allConstructors]
local_variable[type[List], visibleConstructors]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=constructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ofElement, postfix_operators=[], prefix_operators=[], qualifier=Visibility, selectors=[], type_arguments=None), operandr=MemberReference(member=PRIVATE, postfix_operators=[], prefix_operators=[], qualifier=Visibility, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=constructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=visibleConstructors, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=allConstructors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=constructor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExecutableElement, sub_type=None))), label=None)
call[Collections.sort, parameter[member[.visibleConstructors], call[PARAMETER_COUNT_ORDER.reverse, parameter[]]]]
local_variable[type[List], reflectConstructors]
if[binary_operation[call[reflectAnnotations.size, parameter[]], >, literal[0]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=constructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ofElement, postfix_operators=[], prefix_operators=[], qualifier=Visibility, selectors=[], type_arguments=None), operandr=MemberReference(member=PRIVATE, postfix_operators=[], prefix_operators=[], qualifier=Visibility, selectors=[]), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=constructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reflectAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=usesAnyAnnotationsFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=constructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=reflectConstructors, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=allConstructors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=constructor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExecutableElement, sub_type=None))), label=None)
call[Collections.sort, parameter[member[.reflectConstructors], call[PARAMETER_COUNT_ORDER.reverse, parameter[]]]]
else begin[{]
None
end[}]
return[call[.ImmutableList, parameter[]]]
end[}]
END[}]
|
Keyword[static] identifier[ImmutableList] operator[<] identifier[ExecutableElement] operator[>] identifier[orderedConstructorsIn] operator[SEP] identifier[TypeElement] identifier[element] , identifier[List] operator[<] identifier[String] operator[>] identifier[reflectAnnotations] operator[SEP] {
identifier[List] operator[<] identifier[ExecutableElement] operator[>] identifier[allConstructors] operator[=] identifier[ElementFilter] operator[SEP] identifier[constructorsIn] operator[SEP] identifier[element] operator[SEP] identifier[getEnclosedElements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ExecutableElement] operator[>] identifier[visibleConstructors] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[allConstructors] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ExecutableElement] identifier[constructor] operator[:] identifier[allConstructors] operator[SEP] {
Keyword[if] operator[SEP] identifier[Visibility] operator[SEP] identifier[ofElement] operator[SEP] identifier[constructor] operator[SEP] operator[!=] identifier[Visibility] operator[SEP] identifier[PRIVATE] operator[SEP] {
identifier[visibleConstructors] operator[SEP] identifier[add] operator[SEP] identifier[constructor] operator[SEP] operator[SEP]
}
}
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[visibleConstructors] , identifier[PARAMETER_COUNT_ORDER] operator[SEP] identifier[reverse] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ExecutableElement] operator[>] identifier[reflectConstructors] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reflectAnnotations] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[for] operator[SEP] identifier[ExecutableElement] identifier[constructor] operator[:] identifier[allConstructors] operator[SEP] {
Keyword[if] operator[SEP] identifier[Visibility] operator[SEP] identifier[ofElement] operator[SEP] identifier[constructor] operator[SEP] operator[==] identifier[Visibility] operator[SEP] identifier[PRIVATE] operator[&&] identifier[usesAnyAnnotationsFrom] operator[SEP] identifier[constructor] , identifier[reflectAnnotations] operator[SEP] operator[SEP] {
identifier[reflectConstructors] operator[SEP] identifier[add] operator[SEP] identifier[constructor] operator[SEP] operator[SEP]
}
}
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[reflectConstructors] , identifier[PARAMETER_COUNT_ORDER] operator[SEP] identifier[reverse] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ImmutableList] operator[SEP] operator[<] identifier[ExecutableElement] operator[>] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[visibleConstructors] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[reflectConstructors] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public String findConnectorPropertyString(String desiredPropertyName, String defaultValue) {
String retVal = defaultValue;
String name = null;
ConnectorProperty property = null;
Enumeration<Object> e = this.elements();
while (e.hasMoreElements()) {
property = (ConnectorProperty) e.nextElement();
name = property.getName();
if (name.equals(desiredPropertyName)) {
retVal = (String) property.getValue();
}
}
return retVal;
}
|
class class_name[name] begin[{]
method[findConnectorPropertyString, return_type[type[String]], modifier[public], parameter[desiredPropertyName, defaultValue]] begin[{]
local_variable[type[String], retVal]
local_variable[type[String], name]
local_variable[type[ConnectorProperty], property]
local_variable[type[Enumeration], e]
while[call[e.hasMoreElements, parameter[]]] begin[{]
assign[member[.property], Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ConnectorProperty, sub_type=None))]
assign[member[.name], call[property.getName, parameter[]]]
if[call[name.equals, parameter[member[.desiredPropertyName]]]] begin[{]
assign[member[.retVal], Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]
else begin[{]
None
end[}]
end[}]
return[member[.retVal]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[findConnectorPropertyString] operator[SEP] identifier[String] identifier[desiredPropertyName] , identifier[String] identifier[defaultValue] operator[SEP] {
identifier[String] identifier[retVal] operator[=] identifier[defaultValue] operator[SEP] identifier[String] identifier[name] operator[=] Other[null] operator[SEP] identifier[ConnectorProperty] identifier[property] operator[=] Other[null] operator[SEP] identifier[Enumeration] operator[<] identifier[Object] operator[>] identifier[e] operator[=] Keyword[this] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[e] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[property] operator[=] operator[SEP] identifier[ConnectorProperty] operator[SEP] identifier[e] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[=] identifier[property] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[desiredPropertyName] operator[SEP] operator[SEP] {
identifier[retVal] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[property] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[retVal] operator[SEP]
}
|
protected File getMetadataBackupFile(final AbstractResource metadataResource,
final SamlRegisteredService service) throws IOException {
LOGGER.debug("Metadata backup directory is at [{}]", this.metadataBackupDirectory.getCanonicalPath());
val metadataFileName = getBackupMetadataFilenamePrefix(metadataResource, service).concat(FILENAME_EXTENSION_XML);
val backupFile = new File(this.metadataBackupDirectory, metadataFileName);
if (backupFile.exists()) {
LOGGER.info("Metadata file designated for service [{}] already exists at path [{}].", service.getName(), backupFile.getCanonicalPath());
} else {
LOGGER.debug("Metadata to fetch for service [{}] will be placed at [{}]", service.getName(), backupFile.getCanonicalPath());
}
return backupFile;
}
|
class class_name[name] begin[{]
method[getMetadataBackupFile, return_type[type[File]], modifier[protected], parameter[metadataResource, service]] begin[{]
call[LOGGER.debug, parameter[literal["Metadata backup directory is at [{}]"], THIS[member[None.metadataBackupDirectory]call[None.getCanonicalPath, parameter[]]]]]
local_variable[type[val], metadataFileName]
local_variable[type[val], backupFile]
if[call[backupFile.exists, parameter[]]] begin[{]
call[LOGGER.info, parameter[literal["Metadata file designated for service [{}] already exists at path [{}]."], call[service.getName, parameter[]], call[backupFile.getCanonicalPath, parameter[]]]]
else begin[{]
call[LOGGER.debug, parameter[literal["Metadata to fetch for service [{}] will be placed at [{}]"], call[service.getName, parameter[]], call[backupFile.getCanonicalPath, parameter[]]]]
end[}]
return[member[.backupFile]]
end[}]
END[}]
|
Keyword[protected] identifier[File] identifier[getMetadataBackupFile] operator[SEP] Keyword[final] identifier[AbstractResource] identifier[metadataResource] , Keyword[final] identifier[SamlRegisteredService] identifier[service] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[metadataBackupDirectory] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[metadataFileName] operator[=] identifier[getBackupMetadataFilenamePrefix] operator[SEP] identifier[metadataResource] , identifier[service] operator[SEP] operator[SEP] identifier[concat] operator[SEP] identifier[FILENAME_EXTENSION_XML] operator[SEP] operator[SEP] identifier[val] identifier[backupFile] operator[=] Keyword[new] identifier[File] operator[SEP] Keyword[this] operator[SEP] identifier[metadataBackupDirectory] , identifier[metadataFileName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[backupFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[service] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[backupFile] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[service] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[backupFile] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[backupFile] operator[SEP]
}
|
@Override
public void watchInputSource(String inputSource) {
File file = new File(inputSource);
if (!file.exists()) {
log.warn(MessageManager.getMessage("filewatcher.fileNotFound"), file.getAbsolutePath());
return;
}
if (watchingFileMap.containsKey(file.getAbsolutePath())) {
return;
}
log.info(MessageManager.getMessage("filewatcher.addFile"), file.getAbsolutePath());
watchingFileMap.put(file.getAbsolutePath(),
new InputSource(inputSource, file.lastModified()));
File dir = file.getParentFile();
if (watchingDirSet.contains(dir.getAbsolutePath())) {
return;
}
log.info(MessageManager.getMessage("filewatcher.addDirectory"), dir.getAbsolutePath());
watchingDirSet.add(dir.getAbsolutePath());
Path dirPath = dir.toPath();
try {
if (watcher == null) {
// TODO ファイル監視方式の統一
watcher = FileSystems.getDefault().newWatchService();
}
WatchKey watchKey = dirPath.register(watcher, StandardWatchEventKinds.ENTRY_MODIFY);
pathMap.put(watchKey, dirPath);
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
|
class class_name[name] begin[{]
method[watchInputSource, return_type[void], modifier[public], parameter[inputSource]] begin[{]
local_variable[type[File], file]
if[call[file.exists, parameter[]]] begin[{]
call[log.warn, parameter[call[MessageManager.getMessage, parameter[literal["filewatcher.fileNotFound"]]], call[file.getAbsolutePath, parameter[]]]]
return[None]
else begin[{]
None
end[}]
if[call[watchingFileMap.containsKey, parameter[call[file.getAbsolutePath, parameter[]]]]] begin[{]
return[None]
else begin[{]
None
end[}]
call[log.info, parameter[call[MessageManager.getMessage, parameter[literal["filewatcher.addFile"]]], call[file.getAbsolutePath, parameter[]]]]
call[watchingFileMap.put, parameter[call[file.getAbsolutePath, parameter[]], ClassCreator(arguments=[MemberReference(member=inputSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=lastModified, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputSource, sub_type=None))]]
local_variable[type[File], dir]
if[call[watchingDirSet.contains, parameter[call[dir.getAbsolutePath, parameter[]]]]] begin[{]
return[None]
else begin[{]
None
end[}]
call[log.info, parameter[call[MessageManager.getMessage, parameter[literal["filewatcher.addDirectory"]]], call[dir.getAbsolutePath, parameter[]]]]
call[watchingDirSet.add, parameter[call[dir.getAbsolutePath, parameter[]]]]
local_variable[type[Path], dirPath]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=watcher, 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=watcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=FileSystems, selectors=[MethodInvocation(arguments=[], member=newWatchService, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=watcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ENTRY_MODIFY, postfix_operators=[], prefix_operators=[], qualifier=StandardWatchEventKinds, selectors=[])], member=register, postfix_operators=[], prefix_operators=[], qualifier=dirPath, selectors=[], type_arguments=None), name=watchKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WatchKey, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=watchKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dirPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=pathMap, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, 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[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[watchInputSource] operator[SEP] identifier[String] identifier[inputSource] operator[SEP] {
identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[inputSource] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] identifier[MessageManager] operator[SEP] identifier[getMessage] operator[SEP] literal[String] operator[SEP] , identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[watchingFileMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[log] operator[SEP] identifier[info] operator[SEP] identifier[MessageManager] operator[SEP] identifier[getMessage] operator[SEP] literal[String] operator[SEP] , identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[watchingFileMap] operator[SEP] identifier[put] operator[SEP] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , Keyword[new] identifier[InputSource] operator[SEP] identifier[inputSource] , identifier[file] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[dir] operator[=] identifier[file] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[watchingDirSet] operator[SEP] identifier[contains] operator[SEP] identifier[dir] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[log] operator[SEP] identifier[info] operator[SEP] identifier[MessageManager] operator[SEP] identifier[getMessage] operator[SEP] literal[String] operator[SEP] , identifier[dir] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[watchingDirSet] operator[SEP] identifier[add] operator[SEP] identifier[dir] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[dirPath] operator[=] identifier[dir] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[watcher] operator[==] Other[null] operator[SEP] {
identifier[watcher] operator[=] identifier[FileSystems] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[newWatchService] operator[SEP] operator[SEP] operator[SEP]
}
identifier[WatchKey] identifier[watchKey] operator[=] identifier[dirPath] operator[SEP] identifier[register] operator[SEP] identifier[watcher] , identifier[StandardWatchEventKinds] operator[SEP] identifier[ENTRY_MODIFY] operator[SEP] operator[SEP] identifier[pathMap] operator[SEP] identifier[put] operator[SEP] identifier[watchKey] , identifier[dirPath] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public void registerOnMessage(Message.Builder builder) {
messageMap.put(builder.getDescriptorForType().getFullName(), builder);
}
|
class class_name[name] begin[{]
method[registerOnMessage, return_type[void], modifier[public], parameter[builder]] begin[{]
call[messageMap.put, parameter[call[builder.getDescriptorForType, parameter[]], member[.builder]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[registerOnMessage] operator[SEP] identifier[Message] operator[SEP] identifier[Builder] identifier[builder] operator[SEP] {
identifier[messageMap] operator[SEP] identifier[put] operator[SEP] identifier[builder] operator[SEP] identifier[getDescriptorForType] operator[SEP] operator[SEP] operator[SEP] identifier[getFullName] operator[SEP] operator[SEP] , identifier[builder] operator[SEP] operator[SEP]
}
|
@Override
public String getOrigin() {
try {
return ((ServletRequest) ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes())
.getRequest()).getRemoteAddr();
} catch (Exception e) {
e.printStackTrace();
}
return undefienedOriginName;
}
|
class class_name[name] begin[{]
method[getOrigin, return_type[type[String]], modifier[public], parameter[]] begin[{]
TryStatement(block=[ReturnStatement(expression=Cast(expression=Cast(expression=MethodInvocation(arguments=[], member=currentRequestAttributes, postfix_operators=[], prefix_operators=[], qualifier=RequestContextHolder, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ServletRequestAttributes, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=ServletRequest, sub_type=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=['Exception']))], finally_block=None, label=None, resources=None)
return[member[.undefienedOriginName]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getOrigin] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[return] operator[SEP] operator[SEP] identifier[ServletRequest] operator[SEP] operator[SEP] operator[SEP] identifier[ServletRequestAttributes] operator[SEP] identifier[RequestContextHolder] operator[SEP] identifier[currentRequestAttributes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getRemoteAddr] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[undefienedOriginName] operator[SEP]
}
|
public Vector3f sub(Vector3fc v, Vector3f dest) {
dest.x = x - v.x();
dest.y = y - v.y();
dest.z = z - v.z();
return dest;
}
|
class class_name[name] begin[{]
method[sub, return_type[type[Vector3f]], modifier[public], parameter[v, dest]] begin[{]
assign[member[dest.x], binary_operation[member[.x], -, call[v.x, parameter[]]]]
assign[member[dest.y], binary_operation[member[.y], -, call[v.y, parameter[]]]]
assign[member[dest.z], binary_operation[member[.z], -, call[v.z, parameter[]]]]
return[member[.dest]]
end[}]
END[}]
|
Keyword[public] identifier[Vector3f] identifier[sub] operator[SEP] identifier[Vector3fc] identifier[v] , identifier[Vector3f] identifier[dest] operator[SEP] {
identifier[dest] operator[SEP] identifier[x] operator[=] identifier[x] operator[-] identifier[v] operator[SEP] identifier[x] operator[SEP] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[y] operator[=] identifier[y] operator[-] identifier[v] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[z] operator[=] identifier[z] operator[-] identifier[v] operator[SEP] identifier[z] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dest] operator[SEP]
}
|
synchronized void addRepository(String repository, File file) {
// Note : There should be only one (of course), but I think we should
// keep this a bit generic
if (repository == null)
return;
if (log.isDebugEnabled())
log.debug("addRepository(" + repository + ")");
int i;
// Add this repository to our internal list
String[] result = new String[repositories.length + 1];
for (i = 0; i < repositories.length; i++) {
result[i] = repositories[i];
}
result[repositories.length] = repository;
repositories = result;
// Add the file to the list
File[] result2 = new File[files.length + 1];
for (i = 0; i < files.length; i++) {
result2[i] = files[i];
}
result2[files.length] = file;
files = result2;
}
|
class class_name[name] begin[{]
method[addRepository, return_type[void], modifier[synchronized], parameter[repository, file]] begin[{]
if[binary_operation[member[.repository], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[call[log.isDebugEnabled, parameter[]]] begin[{]
call[log.debug, parameter[binary_operation[binary_operation[literal["addRepository("], +, member[.repository]], +, literal[")"]]]]
else begin[{]
None
end[}]
local_variable[type[int], i]
local_variable[type[String], result]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=repositories, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=repositories, 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)
assign[member[.result], member[.repository]]
assign[member[.repositories], member[.result]]
local_variable[type[File], result2]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=files, 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)
assign[member[.result2], member[.file]]
assign[member[.files], member[.result2]]
end[}]
END[}]
|
Keyword[synchronized] Keyword[void] identifier[addRepository] operator[SEP] identifier[String] identifier[repository] , identifier[File] identifier[file] operator[SEP] {
Keyword[if] operator[SEP] identifier[repository] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[repository] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[repositories] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[repositories] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[repositories] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
identifier[result] operator[SEP] identifier[repositories] operator[SEP] identifier[length] operator[SEP] operator[=] identifier[repository] operator[SEP] identifier[repositories] operator[=] identifier[result] operator[SEP] identifier[File] operator[SEP] operator[SEP] identifier[result2] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[files] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[files] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[result2] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
identifier[result2] operator[SEP] identifier[files] operator[SEP] identifier[length] operator[SEP] operator[=] identifier[file] operator[SEP] identifier[files] operator[=] identifier[result2] operator[SEP]
}
|
public static String formatDate(Date date, String pattern) {
if (date == null) throw new IllegalArgumentException("date is null");
if (pattern == null) throw new IllegalArgumentException("pattern is null");
SimpleDateFormat formatter = DateFormatHolder.formatFor(pattern);
return formatter.format(date);
}
|
class class_name[name] begin[{]
method[formatDate, return_type[type[String]], modifier[public static], parameter[date, pattern]] begin[{]
if[binary_operation[member[.date], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="date is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.pattern], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pattern is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[SimpleDateFormat], formatter]
return[call[formatter.format, parameter[member[.date]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[formatDate] operator[SEP] identifier[Date] identifier[date] , identifier[String] identifier[pattern] operator[SEP] {
Keyword[if] operator[SEP] identifier[date] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pattern] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[SimpleDateFormat] identifier[formatter] operator[=] identifier[DateFormatHolder] operator[SEP] identifier[formatFor] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] Keyword[return] identifier[formatter] operator[SEP] identifier[format] operator[SEP] identifier[date] operator[SEP] operator[SEP]
}
|
@Override
public void addURLs(List<URL> urls)
{
for (URL url : urls) {
addURL(url);
}
}
|
class class_name[name] begin[{]
method[addURLs, return_type[void], modifier[public], parameter[urls]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=urls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=url)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None))), label=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addURLs] operator[SEP] identifier[List] operator[<] identifier[URL] operator[>] identifier[urls] operator[SEP] {
Keyword[for] operator[SEP] identifier[URL] identifier[url] operator[:] identifier[urls] operator[SEP] {
identifier[addURL] operator[SEP] identifier[url] operator[SEP] operator[SEP]
}
}
|
private static Budget createSharedBudget(
AdWordsServicesInterface adWordsServices, AdWordsSession session) throws RemoteException {
// Get the BudgetService, which loads the required classes.
BudgetServiceInterface budgetService =
adWordsServices.get(session, BudgetServiceInterface.class);
// Create a shared budget.
Budget budget = new Budget();
budget.setName("Shared Interplanetary Budget #" + System.currentTimeMillis());
budget.setAmount(new Money(null, 50000000L));
budget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
budget.setIsExplicitlyShared(true);
BudgetOperation operation = new BudgetOperation();
operation.setOperand(budget);
operation.setOperator(Operator.ADD);
BudgetOperation[] operations = new BudgetOperation[] {operation};
// Make the mutate request.
BudgetReturnValue result = budgetService.mutate(operations);
Budget newBudget = result.getValue(0);
System.out.printf("Budget with name '%s', ID %d was created.%n", newBudget.getName(),
newBudget.getBudgetId());
return newBudget;
}
|
class class_name[name] begin[{]
method[createSharedBudget, return_type[type[Budget]], modifier[private static], parameter[adWordsServices, session]] begin[{]
local_variable[type[BudgetServiceInterface], budgetService]
local_variable[type[Budget], budget]
call[budget.setName, parameter[binary_operation[literal["Shared Interplanetary Budget #"], +, call[System.currentTimeMillis, parameter[]]]]]
call[budget.setAmount, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=50000000L)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Money, sub_type=None))]]
call[budget.setDeliveryMethod, parameter[member[BudgetBudgetDeliveryMethod.STANDARD]]]
call[budget.setIsExplicitlyShared, parameter[literal[true]]]
local_variable[type[BudgetOperation], operation]
call[operation.setOperand, parameter[member[.budget]]]
call[operation.setOperator, parameter[member[Operator.ADD]]]
local_variable[type[BudgetOperation], operations]
local_variable[type[BudgetReturnValue], result]
local_variable[type[Budget], newBudget]
call[System.out.printf, parameter[literal["Budget with name '%s', ID %d was created.%n"], call[newBudget.getName, parameter[]], call[newBudget.getBudgetId, parameter[]]]]
return[member[.newBudget]]
end[}]
END[}]
|
Keyword[private] Keyword[static] identifier[Budget] identifier[createSharedBudget] operator[SEP] identifier[AdWordsServicesInterface] identifier[adWordsServices] , identifier[AdWordsSession] identifier[session] operator[SEP] Keyword[throws] identifier[RemoteException] {
identifier[BudgetServiceInterface] identifier[budgetService] operator[=] identifier[adWordsServices] operator[SEP] identifier[get] operator[SEP] identifier[session] , identifier[BudgetServiceInterface] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Budget] identifier[budget] operator[=] Keyword[new] identifier[Budget] operator[SEP] operator[SEP] operator[SEP] identifier[budget] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[+] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[budget] operator[SEP] identifier[setAmount] operator[SEP] Keyword[new] identifier[Money] operator[SEP] Other[null] , Other[50000000L] operator[SEP] operator[SEP] operator[SEP] identifier[budget] operator[SEP] identifier[setDeliveryMethod] operator[SEP] identifier[BudgetBudgetDeliveryMethod] operator[SEP] identifier[STANDARD] operator[SEP] operator[SEP] identifier[budget] operator[SEP] identifier[setIsExplicitlyShared] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[BudgetOperation] identifier[operation] operator[=] Keyword[new] identifier[BudgetOperation] operator[SEP] operator[SEP] operator[SEP] identifier[operation] operator[SEP] identifier[setOperand] operator[SEP] identifier[budget] operator[SEP] operator[SEP] identifier[operation] operator[SEP] identifier[setOperator] operator[SEP] identifier[Operator] operator[SEP] identifier[ADD] operator[SEP] operator[SEP] identifier[BudgetOperation] operator[SEP] operator[SEP] identifier[operations] operator[=] Keyword[new] identifier[BudgetOperation] operator[SEP] operator[SEP] {
identifier[operation]
} operator[SEP] identifier[BudgetReturnValue] identifier[result] operator[=] identifier[budgetService] operator[SEP] identifier[mutate] operator[SEP] identifier[operations] operator[SEP] operator[SEP] identifier[Budget] identifier[newBudget] operator[=] identifier[result] operator[SEP] identifier[getValue] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[newBudget] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[newBudget] operator[SEP] identifier[getBudgetId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[newBudget] operator[SEP]
}
|
public static Descriptor getDescriptor(Class<?> cls) throws IOException {
String idl = ProtobufIDLGenerator.getIDL(cls);
ProtoFile file = ProtoSchemaParser.parse(ProtobufIDLProxy.DEFAULT_FILE_NAME, idl);
FileDescriptorProtoPOJO fileDescriptorProto = new FileDescriptorProtoPOJO();
fileDescriptorProto.name = ProtobufIDLProxy.DEFAULT_FILE_NAME;
fileDescriptorProto.pkg = file.getPackageName();
fileDescriptorProto.dependencies = file.getDependencies();
fileDescriptorProto.publicDependency = convertList(file.getPublicDependencies());
fileDescriptorProto.weakDependency = null; // XXX
fileDescriptorProto.messageTypes = new ArrayList<DescriptorProtoPOJO>();
fileDescriptorProto.enumTypes = new ArrayList<EnumDescriptorProtoPOJO>();
fileDescriptorProto.services = new ArrayList<ServiceDescriptorProtoPOJO>();
Set<String> messageSet = new HashSet<String>();
Set<String> enumSet = new HashSet<String>();
List<com.squareup.protoparser.Type> typeElements = file.getTypes();
if (typeElements != null) {
for (com.squareup.protoparser.Type typeElement : typeElements) {
if (typeElement instanceof MessageType) {
messageSet.add(typeElement.getName());
} else if (typeElement instanceof EnumType) {
enumSet.add(typeElement.getName());
}
}
for (com.squareup.protoparser.Type typeElement : typeElements) {
if (typeElement instanceof MessageType) {
fileDescriptorProto.messageTypes.add(
getDescritorProtoPOJO(fileDescriptorProto, (MessageType) typeElement, messageSet, enumSet));
} else if (typeElement instanceof EnumType) {
fileDescriptorProto.enumTypes.add(
getDescritorProtoPOJO(fileDescriptorProto, (EnumType) typeElement, messageSet, enumSet));
}
}
}
FileDescriptorProto fileproto;
try {
Codec<FileDescriptorProtoPOJO> descriptorCodec = ProtobufProxy.create(FileDescriptorProtoPOJO.class,
ProtobufProxy.isCacheEnabled(), ProtobufProxy.OUTPUT_PATH.get());
byte[] bs = descriptorCodec.encode(fileDescriptorProto);
fileproto = FileDescriptorProto.parseFrom(bs);
} catch (InvalidProtocolBufferException e) {
throw new IOException("Failed to parse protocol buffer descriptor for generated code.", e);
}
FileDescriptor fileDescriptor;
try {
fileDescriptor =
FileDescriptor.buildFrom(fileproto, new com.google.protobuf.Descriptors.FileDescriptor[] {});
} catch (DescriptorValidationException e) {
throw new IOException(e.getMessage(), e);
}
return fileDescriptor.getMessageTypes().get(0);
}
|
class class_name[name] begin[{]
method[getDescriptor, return_type[type[Descriptor]], modifier[public static], parameter[cls]] begin[{]
local_variable[type[String], idl]
local_variable[type[ProtoFile], file]
local_variable[type[FileDescriptorProtoPOJO], fileDescriptorProto]
assign[member[fileDescriptorProto.name], member[ProtobufIDLProxy.DEFAULT_FILE_NAME]]
assign[member[fileDescriptorProto.pkg], call[file.getPackageName, parameter[]]]
assign[member[fileDescriptorProto.dependencies], call[file.getDependencies, parameter[]]]
assign[member[fileDescriptorProto.publicDependency], call[.convertList, parameter[call[file.getPublicDependencies, parameter[]]]]]
assign[member[fileDescriptorProto.weakDependency], literal[null]]
assign[member[fileDescriptorProto.messageTypes], 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=DescriptorProtoPOJO, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
assign[member[fileDescriptorProto.enumTypes], 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=EnumDescriptorProtoPOJO, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
assign[member[fileDescriptorProto.services], 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=ServiceDescriptorProtoPOJO, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
local_variable[type[Set], messageSet]
local_variable[type[Set], enumSet]
local_variable[type[List], typeElements]
if[binary_operation[member[.typeElements], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=typeElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=MessageType, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=typeElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=EnumType, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=typeElement, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=enumSet, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=typeElement, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=messageSet, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=typeElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=typeElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=squareup, sub_type=ReferenceType(arguments=None, dimensions=None, name=protoparser, sub_type=ReferenceType(arguments=None, dimensions=None, name=Type, sub_type=None)))))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=typeElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=MessageType, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=typeElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=EnumType, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fileDescriptorProto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=typeElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EnumType, sub_type=None)), MemberReference(member=messageSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enumSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDescritorProtoPOJO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=fileDescriptorProto.enumTypes, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fileDescriptorProto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=typeElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MessageType, sub_type=None)), MemberReference(member=messageSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enumSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDescritorProtoPOJO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=fileDescriptorProto.messageTypes, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=typeElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=typeElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=squareup, sub_type=ReferenceType(arguments=None, dimensions=None, name=protoparser, sub_type=ReferenceType(arguments=None, dimensions=None, name=Type, sub_type=None)))))), label=None)
else begin[{]
None
end[}]
local_variable[type[FileDescriptorProto], fileproto]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileDescriptorProtoPOJO, sub_type=None)), MethodInvocation(arguments=[], member=isCacheEnabled, postfix_operators=[], prefix_operators=[], qualifier=ProtobufProxy, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=ProtobufProxy.OUTPUT_PATH, selectors=[], type_arguments=None)], member=create, postfix_operators=[], prefix_operators=[], qualifier=ProtobufProxy, selectors=[], type_arguments=None), name=descriptorCodec)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=FileDescriptorProtoPOJO, sub_type=None))], dimensions=[], name=Codec, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=fileDescriptorProto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=descriptorCodec, selectors=[], type_arguments=None), name=bs)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fileproto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=bs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseFrom, postfix_operators=[], prefix_operators=[], qualifier=FileDescriptorProto, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to parse protocol buffer descriptor for generated code."), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvalidProtocolBufferException']))], finally_block=None, label=None, resources=None)
local_variable[type[FileDescriptor], fileDescriptor]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fileDescriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=fileproto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=google, sub_type=ReferenceType(arguments=None, dimensions=None, name=protobuf, sub_type=ReferenceType(arguments=None, dimensions=None, name=Descriptors, sub_type=ReferenceType(arguments=None, dimensions=None, name=FileDescriptor, sub_type=None))))))], member=buildFrom, postfix_operators=[], prefix_operators=[], qualifier=FileDescriptor, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DescriptorValidationException']))], finally_block=None, label=None, resources=None)
return[call[fileDescriptor.getMessageTypes, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Descriptor] identifier[getDescriptor] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[cls] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[idl] operator[=] identifier[ProtobufIDLGenerator] operator[SEP] identifier[getIDL] operator[SEP] identifier[cls] operator[SEP] operator[SEP] identifier[ProtoFile] identifier[file] operator[=] identifier[ProtoSchemaParser] operator[SEP] identifier[parse] operator[SEP] identifier[ProtobufIDLProxy] operator[SEP] identifier[DEFAULT_FILE_NAME] , identifier[idl] operator[SEP] operator[SEP] identifier[FileDescriptorProtoPOJO] identifier[fileDescriptorProto] operator[=] Keyword[new] identifier[FileDescriptorProtoPOJO] operator[SEP] operator[SEP] operator[SEP] identifier[fileDescriptorProto] operator[SEP] identifier[name] operator[=] identifier[ProtobufIDLProxy] operator[SEP] identifier[DEFAULT_FILE_NAME] operator[SEP] identifier[fileDescriptorProto] operator[SEP] identifier[pkg] operator[=] identifier[file] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[SEP] identifier[fileDescriptorProto] operator[SEP] identifier[dependencies] operator[=] identifier[file] operator[SEP] identifier[getDependencies] operator[SEP] operator[SEP] operator[SEP] identifier[fileDescriptorProto] operator[SEP] identifier[publicDependency] operator[=] identifier[convertList] operator[SEP] identifier[file] operator[SEP] identifier[getPublicDependencies] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fileDescriptorProto] operator[SEP] identifier[weakDependency] operator[=] Other[null] operator[SEP] identifier[fileDescriptorProto] operator[SEP] identifier[messageTypes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[DescriptorProtoPOJO] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[fileDescriptorProto] operator[SEP] identifier[enumTypes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[EnumDescriptorProtoPOJO] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[fileDescriptorProto] operator[SEP] identifier[services] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ServiceDescriptorProtoPOJO] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[messageSet] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[enumSet] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[protoparser] operator[SEP] identifier[Type] operator[>] identifier[typeElements] operator[=] identifier[file] operator[SEP] identifier[getTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typeElements] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[protoparser] operator[SEP] identifier[Type] identifier[typeElement] operator[:] identifier[typeElements] operator[SEP] {
Keyword[if] operator[SEP] identifier[typeElement] Keyword[instanceof] identifier[MessageType] operator[SEP] {
identifier[messageSet] operator[SEP] identifier[add] operator[SEP] identifier[typeElement] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[typeElement] Keyword[instanceof] identifier[EnumType] operator[SEP] {
identifier[enumSet] operator[SEP] identifier[add] operator[SEP] identifier[typeElement] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[protoparser] operator[SEP] identifier[Type] identifier[typeElement] operator[:] identifier[typeElements] operator[SEP] {
Keyword[if] operator[SEP] identifier[typeElement] Keyword[instanceof] identifier[MessageType] operator[SEP] {
identifier[fileDescriptorProto] operator[SEP] identifier[messageTypes] operator[SEP] identifier[add] operator[SEP] identifier[getDescritorProtoPOJO] operator[SEP] identifier[fileDescriptorProto] , operator[SEP] identifier[MessageType] operator[SEP] identifier[typeElement] , identifier[messageSet] , identifier[enumSet] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[typeElement] Keyword[instanceof] identifier[EnumType] operator[SEP] {
identifier[fileDescriptorProto] operator[SEP] identifier[enumTypes] operator[SEP] identifier[add] operator[SEP] identifier[getDescritorProtoPOJO] operator[SEP] identifier[fileDescriptorProto] , operator[SEP] identifier[EnumType] operator[SEP] identifier[typeElement] , identifier[messageSet] , identifier[enumSet] operator[SEP] operator[SEP] operator[SEP]
}
}
}
identifier[FileDescriptorProto] identifier[fileproto] operator[SEP] Keyword[try] {
identifier[Codec] operator[<] identifier[FileDescriptorProtoPOJO] operator[>] identifier[descriptorCodec] operator[=] identifier[ProtobufProxy] operator[SEP] identifier[create] operator[SEP] identifier[FileDescriptorProtoPOJO] operator[SEP] Keyword[class] , identifier[ProtobufProxy] operator[SEP] identifier[isCacheEnabled] operator[SEP] operator[SEP] , identifier[ProtobufProxy] operator[SEP] identifier[OUTPUT_PATH] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bs] operator[=] identifier[descriptorCodec] operator[SEP] identifier[encode] operator[SEP] identifier[fileDescriptorProto] operator[SEP] operator[SEP] identifier[fileproto] operator[=] identifier[FileDescriptorProto] operator[SEP] identifier[parseFrom] operator[SEP] identifier[bs] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InvalidProtocolBufferException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
identifier[FileDescriptor] identifier[fileDescriptor] operator[SEP] Keyword[try] {
identifier[fileDescriptor] operator[=] identifier[FileDescriptor] operator[SEP] identifier[buildFrom] operator[SEP] identifier[fileproto] , Keyword[new] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[protobuf] operator[SEP] identifier[Descriptors] operator[SEP] identifier[FileDescriptor] operator[SEP] operator[SEP] {
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DescriptorValidationException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[fileDescriptor] operator[SEP] identifier[getMessageTypes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
|
public static String getCharset(@NotNull String mime, String fallback) {
// TODO: exceptions json and which other should also be marked as text
if (mime.startsWith("text")) {
return defaultContentEncoding;
}
return fallback;
}
|
class class_name[name] begin[{]
method[getCharset, return_type[type[String]], modifier[public static], parameter[mime, fallback]] begin[{]
if[call[mime.startsWith, parameter[literal["text"]]]] begin[{]
return[member[.defaultContentEncoding]]
else begin[{]
None
end[}]
return[member[.fallback]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[getCharset] operator[SEP] annotation[@] identifier[NotNull] identifier[String] identifier[mime] , identifier[String] identifier[fallback] operator[SEP] {
Keyword[if] operator[SEP] identifier[mime] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] identifier[defaultContentEncoding] operator[SEP]
}
Keyword[return] identifier[fallback] operator[SEP]
}
|
@Deprecated
public IssueRelation createRelation(Integer issueId, Integer issueToId, String type) throws RedmineException {
return new IssueRelation(transport, issueId, issueToId, type)
.create();
}
|
class class_name[name] begin[{]
method[createRelation, return_type[type[IssueRelation]], modifier[public], parameter[issueId, issueToId, type]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=transport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=issueId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=issueToId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=create, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=IssueRelation, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[Deprecated] Keyword[public] identifier[IssueRelation] identifier[createRelation] operator[SEP] identifier[Integer] identifier[issueId] , identifier[Integer] identifier[issueToId] , identifier[String] identifier[type] operator[SEP] Keyword[throws] identifier[RedmineException] {
Keyword[return] Keyword[new] identifier[IssueRelation] operator[SEP] identifier[transport] , identifier[issueId] , identifier[issueToId] , identifier[type] operator[SEP] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP]
}
|
public void read(LineHandler handler, int size) throws Exception
{
File rootFile = new File(root);
File[] files;
if (rootFile.isDirectory())
{
files = rootFile.listFiles(new FileFilter()
{
@Override
public boolean accept(File pathname)
{
return pathname.isFile() && !pathname.getName().endsWith(".bin");
}
});
if (files == null)
{
if (rootFile.isFile())
files = new File[]{rootFile};
else return;
}
}
else
{
files = new File[]{rootFile};
}
int n = 0;
int totalAddress = 0;
long start = System.currentTimeMillis();
for (File file : files)
{
if (size-- == 0) break;
if (file.isDirectory()) continue;
if (verbose) System.out.printf("正在处理%s, %d / %d\n", file.getName(), ++n, files.length);
IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(file.getAbsolutePath());
while (lineIterator.hasNext())
{
++totalAddress;
String line = lineIterator.next();
if (line.length() == 0) continue;
handler.handle(line);
}
}
handler.done();
if (verbose) System.out.printf("处理了 %.2f 万行,花费了 %.2f min\n", totalAddress / 10000.0, (System.currentTimeMillis() - start) / 1000.0 / 60.0);
}
|
class class_name[name] begin[{]
method[read, return_type[void], modifier[public], parameter[handler, size]] begin[{]
local_variable[type[File], rootFile]
local_variable[type[File], files]
if[call[rootFile.isDirectory, parameter[]]] begin[{]
assign[member[.files], call[rootFile.listFiles, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isFile, postfix_operators=[], prefix_operators=[], qualifier=pathname, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=['!'], qualifier=pathname, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".bin")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), label=None)], documentation=None, modifiers={'public'}, name=accept, parameters=[FormalParameter(annotations=[], modifiers=set(), name=pathname, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileFilter, sub_type=None))]]]
if[binary_operation[member[.files], ==, literal[null]]] begin[{]
if[call[rootFile.isFile, parameter[]]] begin[{]
assign[member[.files], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=rootFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]
else begin[{]
return[None]
end[}]
else begin[{]
None
end[}]
else begin[{]
assign[member[.files], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=rootFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]
end[}]
local_variable[type[int], n]
local_variable[type[int], totalAddress]
local_variable[type[long], start]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=size, 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=BreakStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=MemberReference(member=verbose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="正在处理%s, %d / %d\n"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), MemberReference(member=n, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=files, selectors=[])], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOUtil, sub_type=ReferenceType(arguments=None, dimensions=None, name=LineIterator, sub_type=None))), name=lineIterator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IOUtil, sub_type=ReferenceType(arguments=None, dimensions=None, name=LineIterator, sub_type=None))), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=totalAddress, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=lineIterator, selectors=[], type_arguments=None), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handle, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=lineIterator, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None)
call[handler.done, parameter[]]
if[member[.verbose]] begin[{]
call[System.out.printf, parameter[literal["处理了 %.2f 万行,花费了 %.2f min\n"], binary_operation[member[.totalAddress], /, literal[10000.0]], binary_operation[binary_operation[binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.start]], /, literal[1000.0]], /, literal[60.0]]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[read] operator[SEP] identifier[LineHandler] identifier[handler] , Keyword[int] identifier[size] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[File] identifier[rootFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[root] operator[SEP] operator[SEP] identifier[File] operator[SEP] operator[SEP] identifier[files] operator[SEP] Keyword[if] operator[SEP] identifier[rootFile] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] {
identifier[files] operator[=] identifier[rootFile] operator[SEP] identifier[listFiles] operator[SEP] Keyword[new] identifier[FileFilter] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[accept] operator[SEP] identifier[File] identifier[pathname] operator[SEP] {
Keyword[return] identifier[pathname] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[pathname] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[files] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[rootFile] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] identifier[files] operator[=] Keyword[new] identifier[File] operator[SEP] operator[SEP] {
identifier[rootFile]
} operator[SEP] Keyword[else] Keyword[return] operator[SEP]
}
}
Keyword[else] {
identifier[files] operator[=] Keyword[new] identifier[File] operator[SEP] operator[SEP] {
identifier[rootFile]
} operator[SEP]
}
Keyword[int] identifier[n] operator[=] Other[0] operator[SEP] Keyword[int] identifier[totalAddress] operator[=] Other[0] operator[SEP] Keyword[long] identifier[start] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[File] identifier[file] operator[:] identifier[files] operator[SEP] {
Keyword[if] operator[SEP] identifier[size] operator[--] operator[==] Other[0] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[verbose] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , operator[++] identifier[n] , identifier[files] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[IOUtil] operator[SEP] identifier[LineIterator] identifier[lineIterator] operator[=] Keyword[new] identifier[IOUtil] operator[SEP] identifier[LineIterator] operator[SEP] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[lineIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
operator[++] identifier[totalAddress] operator[SEP] identifier[String] identifier[line] operator[=] identifier[lineIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[continue] operator[SEP] identifier[handler] operator[SEP] identifier[handle] operator[SEP] identifier[line] operator[SEP] operator[SEP]
}
}
identifier[handler] operator[SEP] identifier[done] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[verbose] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[totalAddress] operator[/] literal[Float] , operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[start] operator[SEP] operator[/] literal[Float] operator[/] literal[Float] operator[SEP] operator[SEP]
}
|
private void callDestinationListener(String destinationName) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "callDestinationListener", new Object[] { destinationName });
DestinationListenerDataObject listenerDataObject = null;
DestinationListener destinationListener = null;
DestinationAvailability listenersDestinationAvailability = null;
SICoreConnection listenersConnection = null;
DestinationNamePattern destinationNamePattern = null;
BaseDestinationHandler destinationHandler = null;
try
{
destinationHandler = (BaseDestinationHandler) getDestination(destinationName, false);
} catch (SIMPDestinationCorruptException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DestinationManager.callDestinationListener",
"1:7589:1.508.1.7",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "callDestinationListener", "Destination corrupt");
// Finding that a restored destination has been marked as corrupt is no
// reason to cause the transaction to fail. Andrew Whitfield says that
// a destination listener will not want to know about corrupt destinations
// so we end up just returning.
return;
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DestinationManager.callDestinationListener",
"1:7608:1.508.1.7",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "callDestinationListener", "SIResourceException");
throw new SIResourceException(e);
}
if (!(destinationHandler.definition.getDestinationType() == DestinationType.TOPICSPACE))
{
for (int i = 0; i < destinationListeners.size(); i++)
{
listenerDataObject = destinationListeners.get(i);
destinationListener = listenerDataObject.getDestinationLister();
listenersDestinationAvailability = listenerDataObject.getDestinationAvailability();
listenersConnection = listenerDataObject.getConnection();
destinationNamePattern = listenerDataObject.getDestinationNamePattern();
SIDestinationAddress destinationAddress = null;
if (isAvailable(destinationHandler, listenersDestinationAvailability)
&& (!(destinationHandler.isSystem()))
&& listenerDataObject.getDestinationType() == destinationHandler.definition.getDestinationType())
{
// Check whether a destination name pattern was specified
if (destinationNamePattern == null || destinationNamePattern.match(destinationName))
{
// No pattern or the pattern matches the name.
destinationAddress =
(
(SIDestinationAddressFactory) MessageProcessor.getSingletonInstance(
SIMPConstants.SI_DESTINATION_ADDRESS_FACTORY)).createSIDestinationAddress(
destinationHandler.getName(),
true);
// call the listener
destinationListener.destinationAvailable(
listenersConnection,
destinationAddress,
listenersDestinationAvailability);
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "callDestinationListener");
}
|
class class_name[name] begin[{]
method[callDestinationListener, return_type[void], modifier[private], parameter[destinationName]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["callDestinationListener"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=destinationName, 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[DestinationListenerDataObject], listenerDataObject]
local_variable[type[DestinationListener], destinationListener]
local_variable[type[DestinationAvailability], listenersDestinationAvailability]
local_variable[type[SICoreConnection], listenersConnection]
local_variable[type[DestinationNamePattern], destinationNamePattern]
local_variable[type[BaseDestinationHandler], destinationHandler]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=destinationHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=destinationName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getDestination, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=BaseDestinationHandler, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.DestinationManager.callDestinationListener"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:7589:1.508.1.7"), 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=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="callDestinationListener"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination corrupt")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SIMPDestinationCorruptException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.DestinationManager.callDestinationListener"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:7608:1.508.1.7"), 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=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="callDestinationListener"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SIResourceException")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), 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=SIResourceException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SIException']))], finally_block=None, label=None, resources=None)
if[binary_operation[call[destinationHandler.definition.getDestinationType, parameter[]], ==, member[DestinationType.TOPICSPACE]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=listenerDataObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=destinationListeners, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=destinationListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getDestinationLister, postfix_operators=[], prefix_operators=[], qualifier=listenerDataObject, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=listenersDestinationAvailability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getDestinationAvailability, postfix_operators=[], prefix_operators=[], qualifier=listenerDataObject, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=listenersConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=listenerDataObject, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=destinationNamePattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getDestinationNamePattern, postfix_operators=[], prefix_operators=[], qualifier=listenerDataObject, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=destinationAddress)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SIDestinationAddress, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=destinationHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=listenersDestinationAvailability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAvailable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isSystem, postfix_operators=[], prefix_operators=[], qualifier=destinationHandler, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDestinationType, postfix_operators=[], prefix_operators=[], qualifier=listenerDataObject, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getDestinationType, postfix_operators=[], prefix_operators=[], qualifier=destinationHandler.definition, selectors=[], type_arguments=None), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=destinationNamePattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=destinationName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=destinationNamePattern, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=destinationAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=SI_DESTINATION_ADDRESS_FACTORY, postfix_operators=[], prefix_operators=[], qualifier=SIMPConstants, selectors=[])], member=getSingletonInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageProcessor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SIDestinationAddressFactory, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=listenersConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=destinationAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=listenersDestinationAvailability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=destinationAvailable, postfix_operators=[], prefix_operators=[], qualifier=destinationListener, 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=destinationListeners, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["callDestinationListener"]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[callDestinationListener] operator[SEP] identifier[String] identifier[destinationName] operator[SEP] Keyword[throws] identifier[SIResourceException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[destinationName]
} operator[SEP] operator[SEP] identifier[DestinationListenerDataObject] identifier[listenerDataObject] operator[=] Other[null] operator[SEP] identifier[DestinationListener] identifier[destinationListener] operator[=] Other[null] operator[SEP] identifier[DestinationAvailability] identifier[listenersDestinationAvailability] operator[=] Other[null] operator[SEP] identifier[SICoreConnection] identifier[listenersConnection] operator[=] Other[null] operator[SEP] identifier[DestinationNamePattern] identifier[destinationNamePattern] operator[=] Other[null] operator[SEP] identifier[BaseDestinationHandler] identifier[destinationHandler] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[destinationHandler] operator[=] operator[SEP] identifier[BaseDestinationHandler] operator[SEP] identifier[getDestination] operator[SEP] identifier[destinationName] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SIMPDestinationCorruptException] identifier[e] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SIException] identifier[e] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SIResourceException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[destinationHandler] operator[SEP] identifier[definition] operator[SEP] identifier[getDestinationType] operator[SEP] operator[SEP] operator[==] identifier[DestinationType] operator[SEP] identifier[TOPICSPACE] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[destinationListeners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[listenerDataObject] operator[=] identifier[destinationListeners] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[destinationListener] operator[=] identifier[listenerDataObject] operator[SEP] identifier[getDestinationLister] operator[SEP] operator[SEP] operator[SEP] identifier[listenersDestinationAvailability] operator[=] identifier[listenerDataObject] operator[SEP] identifier[getDestinationAvailability] operator[SEP] operator[SEP] operator[SEP] identifier[listenersConnection] operator[=] identifier[listenerDataObject] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[destinationNamePattern] operator[=] identifier[listenerDataObject] operator[SEP] identifier[getDestinationNamePattern] operator[SEP] operator[SEP] operator[SEP] identifier[SIDestinationAddress] identifier[destinationAddress] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[isAvailable] operator[SEP] identifier[destinationHandler] , identifier[listenersDestinationAvailability] operator[SEP] operator[&&] operator[SEP] operator[!] operator[SEP] identifier[destinationHandler] operator[SEP] identifier[isSystem] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[listenerDataObject] operator[SEP] identifier[getDestinationType] operator[SEP] operator[SEP] operator[==] identifier[destinationHandler] operator[SEP] identifier[definition] operator[SEP] identifier[getDestinationType] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[destinationNamePattern] operator[==] Other[null] operator[||] identifier[destinationNamePattern] operator[SEP] identifier[match] operator[SEP] identifier[destinationName] operator[SEP] operator[SEP] {
identifier[destinationAddress] operator[=] operator[SEP] operator[SEP] identifier[SIDestinationAddressFactory] operator[SEP] identifier[MessageProcessor] operator[SEP] identifier[getSingletonInstance] operator[SEP] identifier[SIMPConstants] operator[SEP] identifier[SI_DESTINATION_ADDRESS_FACTORY] operator[SEP] operator[SEP] operator[SEP] identifier[createSIDestinationAddress] operator[SEP] identifier[destinationHandler] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[destinationListener] operator[SEP] identifier[destinationAvailable] operator[SEP] identifier[listenersConnection] , identifier[destinationAddress] , identifier[listenersDestinationAvailability] operator[SEP] operator[SEP]
}
}
}
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
public <R> Plan0<R> then(Func7<T1, T2, T3, T4, T5, T6, T7, R> selector) {
if (selector == null) {
throw new NullPointerException();
}
return new Plan7<T1, T2, T3, T4, T5, T6, T7, R>(this, selector);
}
|
class class_name[name] begin[{]
method[then, return_type[type[Plan0]], modifier[public], parameter[selector]] begin[{]
if[binary_operation[member[.selector], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=selector, 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=T1, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T2, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T3, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T4, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T5, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T6, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T7, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=None, name=Plan7, sub_type=None))]
end[}]
END[}]
|
Keyword[public] operator[<] identifier[R] operator[>] identifier[Plan0] operator[<] identifier[R] operator[>] identifier[then] operator[SEP] identifier[Func7] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] , identifier[T5] , identifier[T6] , identifier[T7] , identifier[R] operator[>] identifier[selector] operator[SEP] {
Keyword[if] operator[SEP] identifier[selector] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[Plan7] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] , identifier[T5] , identifier[T6] , identifier[T7] , identifier[R] operator[>] operator[SEP] Keyword[this] , identifier[selector] operator[SEP] operator[SEP]
}
|
public static Expression nanIf(Expression expression1, Expression expression2) {
return x("NANIF(" + expression1.toString() + ", " + expression2.toString() + ")");
}
|
class class_name[name] begin[{]
method[nanIf, return_type[type[Expression]], modifier[public static], parameter[expression1, expression2]] begin[{]
return[call[.x, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["NANIF("], +, call[expression1.toString, parameter[]]], +, literal[", "]], +, call[expression2.toString, parameter[]]], +, literal[")"]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Expression] identifier[nanIf] operator[SEP] identifier[Expression] identifier[expression1] , identifier[Expression] identifier[expression2] operator[SEP] {
Keyword[return] identifier[x] operator[SEP] literal[String] operator[+] identifier[expression1] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[expression2] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
|
public void setJarFile(IPath jarFile) {
if (!Objects.equal(jarFile, this.jarFile)) {
final PropertyChangeEvent event = new PropertyChangeEvent(this, ISREInstallChangedListener.PROPERTY_JAR_FILE,
this.jarFile, jarFile);
this.jarFile = jarFile;
setDirty(true);
if (getNotify()) {
SARLRuntime.fireSREChanged(event);
}
}
}
|
class class_name[name] begin[{]
method[setJarFile, return_type[void], modifier[public], parameter[jarFile]] begin[{]
if[call[Objects.equal, parameter[member[.jarFile], THIS[member[None.jarFile]]]]] begin[{]
local_variable[type[PropertyChangeEvent], event]
assign[THIS[member[None.jarFile]], member[.jarFile]]
call[.setDirty, parameter[literal[true]]]
if[call[.getNotify, parameter[]]] begin[{]
call[SARLRuntime.fireSREChanged, parameter[member[.event]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setJarFile] operator[SEP] identifier[IPath] identifier[jarFile] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[Objects] operator[SEP] identifier[equal] operator[SEP] identifier[jarFile] , Keyword[this] operator[SEP] identifier[jarFile] operator[SEP] operator[SEP] {
Keyword[final] identifier[PropertyChangeEvent] identifier[event] operator[=] Keyword[new] identifier[PropertyChangeEvent] operator[SEP] Keyword[this] , identifier[ISREInstallChangedListener] operator[SEP] identifier[PROPERTY_JAR_FILE] , Keyword[this] operator[SEP] identifier[jarFile] , identifier[jarFile] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[jarFile] operator[=] identifier[jarFile] operator[SEP] identifier[setDirty] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getNotify] operator[SEP] operator[SEP] operator[SEP] {
identifier[SARLRuntime] operator[SEP] identifier[fireSREChanged] operator[SEP] identifier[event] operator[SEP] operator[SEP]
}
}
}
|
public GrammaticalFeats getFeats() {
if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_feats == null)
jcasType.jcas.throwFeatMissing("feats", "de.julielab.jules.types.Token");
return (GrammaticalFeats)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Token_Type)jcasType).casFeatCode_feats)));}
|
class class_name[name] begin[{]
method[getFeats, return_type[type[GrammaticalFeats]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[Token_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Token_Type, sub_type=None)), ==, literal[null]]]] begin[{]
call[jcasType.jcas.throwFeatMissing, parameter[literal["feats"], literal["de.julielab.jules.types.Token"]]]
else begin[{]
None
end[}]
return[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=addr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Token_Type, sub_type=None))], member=ll_getRefValue, postfix_operators=[], prefix_operators=[], qualifier=jcasType.ll_cas, selectors=[], type_arguments=None)], member=ll_getFSForRef, postfix_operators=[], prefix_operators=[], qualifier=jcasType.ll_cas, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=GrammaticalFeats, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[GrammaticalFeats] identifier[getFeats] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[Token_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[Token_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_feats] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[GrammaticalFeats] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getFSForRef] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getRefValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[Token_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_feats] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
void addInvokes(MethodDescriptor methodDescriptor, final Integer lineNumber, MethodDescriptor invokedMethodDescriptor) {
InvokesDescriptor invokesDescriptor = scannerContext.getStore().create(methodDescriptor, InvokesDescriptor.class, invokedMethodDescriptor);
invokesDescriptor.setLineNumber(lineNumber);
}
|
class class_name[name] begin[{]
method[addInvokes, return_type[void], modifier[default], parameter[methodDescriptor, lineNumber, invokedMethodDescriptor]] begin[{]
local_variable[type[InvokesDescriptor], invokesDescriptor]
call[invokesDescriptor.setLineNumber, parameter[member[.lineNumber]]]
end[}]
END[}]
|
Keyword[void] identifier[addInvokes] operator[SEP] identifier[MethodDescriptor] identifier[methodDescriptor] , Keyword[final] identifier[Integer] identifier[lineNumber] , identifier[MethodDescriptor] identifier[invokedMethodDescriptor] operator[SEP] {
identifier[InvokesDescriptor] identifier[invokesDescriptor] operator[=] identifier[scannerContext] operator[SEP] identifier[getStore] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[methodDescriptor] , identifier[InvokesDescriptor] operator[SEP] Keyword[class] , identifier[invokedMethodDescriptor] operator[SEP] operator[SEP] identifier[invokesDescriptor] operator[SEP] identifier[setLineNumber] operator[SEP] identifier[lineNumber] operator[SEP] operator[SEP]
}
|
protected synchronized void setupAd(final NativeExpressAdView adView) {
if(mFetchFailCount > MAX_FETCH_ATTEMPT)
return;
if(!mPrefetchedAds.contains(adView))
mPrefetchedAds.add(adView);
adView.setAdListener(new AdListener() {
@Override
public void onAdFailedToLoad(int errorCode) {
super.onAdFailedToLoad(errorCode);
// Handle the failure by logging, altering the UI, etc.
onFailedToLoad(adView, errorCode);
}
@Override
public void onAdLoaded() {
super.onAdLoaded();
onFetched(adView);
}
});
}
|
class class_name[name] begin[{]
method[setupAd, return_type[void], modifier[synchronized protected], parameter[adView]] begin[{]
if[binary_operation[member[.mFetchFailCount], >, member[.MAX_FETCH_ATTEMPT]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[call[mPrefetchedAds.contains, parameter[member[.adView]]]] begin[{]
call[mPrefetchedAds.add, parameter[member[.adView]]]
else begin[{]
None
end[}]
call[adView.setAdListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=SuperMethodInvocation(arguments=[MemberReference(member=errorCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onAdFailedToLoad, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=adView, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=errorCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onFailedToLoad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onAdFailedToLoad, parameters=[FormalParameter(annotations=[], modifiers=set(), name=errorCode, type=BasicType(dimensions=[], name=int), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=SuperMethodInvocation(arguments=[], member=onAdLoaded, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=adView, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onFetched, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onAdLoaded, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AdListener, sub_type=None))]]
end[}]
END[}]
|
Keyword[protected] Keyword[synchronized] Keyword[void] identifier[setupAd] operator[SEP] Keyword[final] identifier[NativeExpressAdView] identifier[adView] operator[SEP] {
Keyword[if] operator[SEP] identifier[mFetchFailCount] operator[>] identifier[MAX_FETCH_ATTEMPT] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mPrefetchedAds] operator[SEP] identifier[contains] operator[SEP] identifier[adView] operator[SEP] operator[SEP] identifier[mPrefetchedAds] operator[SEP] identifier[add] operator[SEP] identifier[adView] operator[SEP] operator[SEP] identifier[adView] operator[SEP] identifier[setAdListener] operator[SEP] Keyword[new] identifier[AdListener] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onAdFailedToLoad] operator[SEP] Keyword[int] identifier[errorCode] operator[SEP] {
Keyword[super] operator[SEP] identifier[onAdFailedToLoad] operator[SEP] identifier[errorCode] operator[SEP] operator[SEP] identifier[onFailedToLoad] operator[SEP] identifier[adView] , identifier[errorCode] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onAdLoaded] operator[SEP] operator[SEP] {
Keyword[super] operator[SEP] identifier[onAdLoaded] operator[SEP] operator[SEP] operator[SEP] identifier[onFetched] operator[SEP] identifier[adView] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
private List<Pair<Subspace, ModifiableDBIDs>> determineClusters(List<CLIQUESubspace> denseSubspaces) {
List<Pair<Subspace, ModifiableDBIDs>> clusters = new ArrayList<>();
for(CLIQUESubspace subspace : denseSubspaces) {
List<Pair<Subspace, ModifiableDBIDs>> clustersInSubspace = subspace.determineClusters();
if(LOG.isDebugging()) {
LOG.debugFine("Subspace " + subspace + " clusters " + clustersInSubspace.size());
}
clusters.addAll(clustersInSubspace);
}
return clusters;
}
|
class class_name[name] begin[{]
method[determineClusters, return_type[type[List]], modifier[private], parameter[denseSubspaces]] begin[{]
local_variable[type[List], clusters]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=determineClusters, postfix_operators=[], prefix_operators=[], qualifier=subspace, selectors=[], type_arguments=None), name=clustersInSubspace)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Subspace, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ModifiableDBIDs, sub_type=None))], dimensions=[], name=Pair, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugging, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), 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="Subspace "), operandr=MemberReference(member=subspace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" clusters "), operator=+), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=clustersInSubspace, selectors=[], type_arguments=None), operator=+)], member=debugFine, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=clustersInSubspace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=clusters, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=denseSubspaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subspace)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CLIQUESubspace, sub_type=None))), label=None)
return[member[.clusters]]
end[}]
END[}]
|
Keyword[private] identifier[List] operator[<] identifier[Pair] operator[<] identifier[Subspace] , identifier[ModifiableDBIDs] operator[>] operator[>] identifier[determineClusters] operator[SEP] identifier[List] operator[<] identifier[CLIQUESubspace] operator[>] identifier[denseSubspaces] operator[SEP] {
identifier[List] operator[<] identifier[Pair] operator[<] identifier[Subspace] , identifier[ModifiableDBIDs] operator[>] operator[>] identifier[clusters] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CLIQUESubspace] identifier[subspace] operator[:] identifier[denseSubspaces] operator[SEP] {
identifier[List] operator[<] identifier[Pair] operator[<] identifier[Subspace] , identifier[ModifiableDBIDs] operator[>] operator[>] identifier[clustersInSubspace] operator[=] identifier[subspace] operator[SEP] identifier[determineClusters] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugging] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[debugFine] operator[SEP] literal[String] operator[+] identifier[subspace] operator[+] literal[String] operator[+] identifier[clustersInSubspace] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[clusters] operator[SEP] identifier[addAll] operator[SEP] identifier[clustersInSubspace] operator[SEP] operator[SEP]
}
Keyword[return] identifier[clusters] operator[SEP]
}
|
private void autoRemoveExpiredCaptcha() {
timer = new Timer("CaptchaCache", true);
timer.schedule(
new TimerTask() {
public void run() {
for (Entry<String, Captcha> e : map.entrySet()) {
if (e.getValue().isExpired()) {
map.remove(e.getKey());
}
}
}
},
interval,
interval
);
}
|
class class_name[name] begin[{]
method[autoRemoveExpiredCaptcha, return_type[void], modifier[private], parameter[]] begin[{]
assign[member[.timer], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CaptchaCache"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Timer, sub_type=None))]
call[timer.schedule, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=isExpired, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=remove, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], 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=Captcha, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TimerTask, sub_type=None)), member[.interval], member[.interval]]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[autoRemoveExpiredCaptcha] operator[SEP] operator[SEP] {
identifier[timer] operator[=] Keyword[new] identifier[Timer] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[schedule] operator[SEP] Keyword[new] identifier[TimerTask] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Captcha] operator[>] identifier[e] operator[:] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[isExpired] operator[SEP] operator[SEP] operator[SEP] {
identifier[map] operator[SEP] identifier[remove] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
} , identifier[interval] , identifier[interval] operator[SEP] operator[SEP]
}
|
public static String readFileContent( File file ) throws IOException {
String result = null;
ByteArrayOutputStream os = new ByteArrayOutputStream();
Utils.copyStream( file, os );
result = os.toString( "UTF-8" );
return result;
}
|
class class_name[name] begin[{]
method[readFileContent, return_type[type[String]], modifier[public static], parameter[file]] begin[{]
local_variable[type[String], result]
local_variable[type[ByteArrayOutputStream], os]
call[Utils.copyStream, parameter[member[.file], member[.os]]]
assign[member[.result], call[os.toString, parameter[literal["UTF-8"]]]]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[readFileContent] operator[SEP] identifier[File] identifier[file] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[result] operator[=] Other[null] operator[SEP] identifier[ByteArrayOutputStream] identifier[os] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[copyStream] operator[SEP] identifier[file] , identifier[os] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[os] operator[SEP] identifier[toString] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public static String getServerId(String clientId) {
String serverId = clientId;
if (clientId.contains(CLIENT_ID_SEPERATOR)) {
serverId = clientId.substring(0, clientId.lastIndexOf(CLIENT_ID_SEPERATOR));
}
return serverId;
}
|
class class_name[name] begin[{]
method[getServerId, return_type[type[String]], modifier[public static], parameter[clientId]] begin[{]
local_variable[type[String], serverId]
if[call[clientId.contains, parameter[member[.CLIENT_ID_SEPERATOR]]]] begin[{]
assign[member[.serverId], call[clientId.substring, parameter[literal[0], call[clientId.lastIndexOf, parameter[member[.CLIENT_ID_SEPERATOR]]]]]]
else begin[{]
None
end[}]
return[member[.serverId]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[getServerId] operator[SEP] identifier[String] identifier[clientId] operator[SEP] {
identifier[String] identifier[serverId] operator[=] identifier[clientId] operator[SEP] Keyword[if] operator[SEP] identifier[clientId] operator[SEP] identifier[contains] operator[SEP] identifier[CLIENT_ID_SEPERATOR] operator[SEP] operator[SEP] {
identifier[serverId] operator[=] identifier[clientId] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[clientId] operator[SEP] identifier[lastIndexOf] operator[SEP] identifier[CLIENT_ID_SEPERATOR] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[serverId] operator[SEP]
}
|
private SearchIndex makeSuggestIndex(StaplerRequest req) {
SearchIndexBuilder builder = new SearchIndexBuilder();
for (Ancestor a : req.getAncestors()) {
if (a.getObject() instanceof SearchableModelObject) {
SearchableModelObject smo = (SearchableModelObject) a.getObject();
builder.add(smo.getSearchIndex());
}
}
return builder.make();
}
|
class class_name[name] begin[{]
method[makeSuggestIndex, return_type[type[SearchIndex]], modifier[private], parameter[req]] begin[{]
local_variable[type[SearchIndexBuilder], builder]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=SearchableModelObject, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SearchableModelObject, sub_type=None)), name=smo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SearchableModelObject, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSearchIndex, postfix_operators=[], prefix_operators=[], qualifier=smo, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAncestors, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=a)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Ancestor, sub_type=None))), label=None)
return[call[builder.make, parameter[]]]
end[}]
END[}]
|
Keyword[private] identifier[SearchIndex] identifier[makeSuggestIndex] operator[SEP] identifier[StaplerRequest] identifier[req] operator[SEP] {
identifier[SearchIndexBuilder] identifier[builder] operator[=] Keyword[new] identifier[SearchIndexBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Ancestor] identifier[a] operator[:] identifier[req] operator[SEP] identifier[getAncestors] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[getObject] operator[SEP] operator[SEP] Keyword[instanceof] identifier[SearchableModelObject] operator[SEP] {
identifier[SearchableModelObject] identifier[smo] operator[=] operator[SEP] identifier[SearchableModelObject] operator[SEP] identifier[a] operator[SEP] identifier[getObject] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[add] operator[SEP] identifier[smo] operator[SEP] identifier[getSearchIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[builder] operator[SEP] identifier[make] operator[SEP] operator[SEP] operator[SEP]
}
|
public synchronized void forget() throws XAException
{
if (tc.isEntryEnabled()) Tr.entry(tc, "forget", _txn);
// replay must have finished
if (_tranManager.isReplayComplete())
{
_heuristic = StatefulResource.NONE;
_txn.notifyCompletion();
}
else
{
if (tc.isEntryEnabled()) Tr.exit(tc, "forget", "throwing XAER_RMFAIL");
throw new XAException(XAException.XAER_RMFAIL);
}
if (tc.isEntryEnabled()) Tr.exit(tc, "forget");
}
|
class class_name[name] begin[{]
method[forget, return_type[void], modifier[synchronized public], parameter[]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.entry, parameter[member[.tc], literal["forget"], member[._txn]]]
else begin[{]
None
end[}]
if[call[_tranManager.isReplayComplete, parameter[]]] begin[{]
assign[member[._heuristic], member[StatefulResource.NONE]]
call[_txn.notifyCompletion, parameter[]]
else begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["forget"], literal["throwing XAER_RMFAIL"]]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=XAER_RMFAIL, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XAException, sub_type=None)), label=None)
end[}]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["forget"]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[synchronized] Keyword[void] identifier[forget] operator[SEP] operator[SEP] Keyword[throws] identifier[XAException] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[_txn] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_tranManager] operator[SEP] identifier[isReplayComplete] operator[SEP] operator[SEP] operator[SEP] {
identifier[_heuristic] operator[=] identifier[StatefulResource] operator[SEP] identifier[NONE] operator[SEP] identifier[_txn] operator[SEP] identifier[notifyCompletion] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[XAException] operator[SEP] identifier[XAException] operator[SEP] identifier[XAER_RMFAIL] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
@Override
public void execute(Runnable runnable) {
if (runnable == null) {
throw new NullPointerException("runnable parameter is null");
}
if (!mWorkQueue.offer(runnable)) {
throw new RejectedExecutionException(
mName + " queue is full, size=" + mWorkQueue.size());
}
final int queueSize = mWorkQueue.size();
final int maxSize = mMaxQueueSize.get();
if ((queueSize > maxSize) && mMaxQueueSize.compareAndSet(maxSize, queueSize)) {
FLog.v(TAG, "%s: max pending work in queue = %d", mName, queueSize);
} // else, there was a race and another thread updated and logged the max queue size
startWorkerIfNeeded();
}
|
class class_name[name] begin[{]
method[execute, return_type[void], modifier[public], parameter[runnable]] begin[{]
if[binary_operation[member[.runnable], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="runnable parameter is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[mWorkQueue.offer, parameter[member[.runnable]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" queue is full, size="), operator=+), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=mWorkQueue, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RejectedExecutionException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], queueSize]
local_variable[type[int], maxSize]
if[binary_operation[binary_operation[member[.queueSize], >, member[.maxSize]], &&, call[mMaxQueueSize.compareAndSet, parameter[member[.maxSize], member[.queueSize]]]]] begin[{]
call[FLog.v, parameter[member[.TAG], literal["%s: max pending work in queue = %d"], member[.mName], member[.queueSize]]]
else begin[{]
None
end[}]
call[.startWorkerIfNeeded, parameter[]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[Runnable] identifier[runnable] operator[SEP] {
Keyword[if] operator[SEP] identifier[runnable] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[mWorkQueue] operator[SEP] identifier[offer] operator[SEP] identifier[runnable] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RejectedExecutionException] operator[SEP] identifier[mName] operator[+] literal[String] operator[+] identifier[mWorkQueue] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[int] identifier[queueSize] operator[=] identifier[mWorkQueue] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[maxSize] operator[=] identifier[mMaxQueueSize] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[queueSize] operator[>] identifier[maxSize] operator[SEP] operator[&&] identifier[mMaxQueueSize] operator[SEP] identifier[compareAndSet] operator[SEP] identifier[maxSize] , identifier[queueSize] operator[SEP] operator[SEP] {
identifier[FLog] operator[SEP] identifier[v] operator[SEP] identifier[TAG] , literal[String] , identifier[mName] , identifier[queueSize] operator[SEP] operator[SEP]
}
identifier[startWorkerIfNeeded] operator[SEP] operator[SEP] operator[SEP]
}
|
private ISource resloveSource(Source source, PropertyResolver resolver, Map<Object, Object> bootstrapMap, Map<Object, Object> defaultMap) {
Class<? extends Locator> locatorClass = source.locator();
if(locatorClass == null) {
locatorClass = NullLocator.class;
}
Locator locator = this.beanResolver.resolveBeanWithDefaultClass(locatorClass, NullLocator.class);
this.logger.trace("Using locator: '{}'", locator.getClass().getName());
// resolve path if enabled
String path = source.value();
if(resolver != null && source.resolve()) {
path = resolver.resolveProperties(path, bootstrapMap, defaultMap);
}
// log path
this.logger.trace("Looking for source at path: '{}'", path);
// locate
ISource foundSource = locator.locate(path);
// log results
this.logger.trace("Source: '{}' (using locator '{}')", foundSource, locator.getClass().getName());
return foundSource;
}
|
class class_name[name] begin[{]
method[resloveSource, return_type[type[ISource]], modifier[private], parameter[source, resolver, bootstrapMap, defaultMap]] begin[{]
local_variable[type[Class], locatorClass]
if[binary_operation[member[.locatorClass], ==, literal[null]]] begin[{]
assign[member[.locatorClass], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullLocator, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[Locator], locator]
THIS[member[None.logger]call[None.trace, parameter[literal["Using locator: '{}'"], call[locator.getClass, parameter[]]]]]
local_variable[type[String], path]
if[binary_operation[binary_operation[member[.resolver], !=, literal[null]], &&, call[source.resolve, parameter[]]]] begin[{]
assign[member[.path], call[resolver.resolveProperties, parameter[member[.path], member[.bootstrapMap], member[.defaultMap]]]]
else begin[{]
None
end[}]
THIS[member[None.logger]call[None.trace, parameter[literal["Looking for source at path: '{}'"], member[.path]]]]
local_variable[type[ISource], foundSource]
THIS[member[None.logger]call[None.trace, parameter[literal["Source: '{}' (using locator '{}')"], member[.foundSource], call[locator.getClass, parameter[]]]]]
return[member[.foundSource]]
end[}]
END[}]
|
Keyword[private] identifier[ISource] identifier[resloveSource] operator[SEP] identifier[Source] identifier[source] , identifier[PropertyResolver] identifier[resolver] , identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[bootstrapMap] , identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[defaultMap] operator[SEP] {
identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Locator] operator[>] identifier[locatorClass] operator[=] identifier[source] operator[SEP] identifier[locator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[locatorClass] operator[==] Other[null] operator[SEP] {
identifier[locatorClass] operator[=] identifier[NullLocator] operator[SEP] Keyword[class] operator[SEP]
}
identifier[Locator] identifier[locator] operator[=] Keyword[this] operator[SEP] identifier[beanResolver] operator[SEP] identifier[resolveBeanWithDefaultClass] operator[SEP] identifier[locatorClass] , identifier[NullLocator] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[locator] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[path] operator[=] identifier[source] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resolver] operator[!=] Other[null] operator[&&] identifier[source] operator[SEP] identifier[resolve] operator[SEP] operator[SEP] operator[SEP] {
identifier[path] operator[=] identifier[resolver] operator[SEP] identifier[resolveProperties] operator[SEP] identifier[path] , identifier[bootstrapMap] , identifier[defaultMap] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[path] operator[SEP] operator[SEP] identifier[ISource] identifier[foundSource] operator[=] identifier[locator] operator[SEP] identifier[locate] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[foundSource] , identifier[locator] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[foundSource] operator[SEP]
}
|
@Override
public ImmutableSortedMap<K, V> tailMap(K fromKey, boolean inclusive) {
return getSubMap(keySet.tailIndex(checkNotNull(fromKey), inclusive), size());
}
|
class class_name[name] begin[{]
method[tailMap, return_type[type[ImmutableSortedMap]], modifier[public], parameter[fromKey, inclusive]] begin[{]
return[call[.getSubMap, parameter[call[keySet.tailIndex, parameter[call[.checkNotNull, parameter[member[.fromKey]]], member[.inclusive]]], call[.size, parameter[]]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[ImmutableSortedMap] operator[<] identifier[K] , identifier[V] operator[>] identifier[tailMap] operator[SEP] identifier[K] identifier[fromKey] , Keyword[boolean] identifier[inclusive] operator[SEP] {
Keyword[return] identifier[getSubMap] operator[SEP] identifier[keySet] operator[SEP] identifier[tailIndex] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[fromKey] operator[SEP] , identifier[inclusive] operator[SEP] , identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setDeviceMethods(java.util.Collection<DeviceMethod> deviceMethods) {
if (deviceMethods == null) {
this.deviceMethods = null;
return;
}
this.deviceMethods = new java.util.ArrayList<DeviceMethod>(deviceMethods);
}
|
class class_name[name] begin[{]
method[setDeviceMethods, return_type[void], modifier[public], parameter[deviceMethods]] begin[{]
if[binary_operation[member[.deviceMethods], ==, literal[null]]] begin[{]
assign[THIS[member[None.deviceMethods]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.deviceMethods]], ClassCreator(arguments=[MemberReference(member=deviceMethods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DeviceMethod, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setDeviceMethods] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[DeviceMethod] operator[>] identifier[deviceMethods] operator[SEP] {
Keyword[if] operator[SEP] identifier[deviceMethods] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[deviceMethods] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[deviceMethods] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[DeviceMethod] operator[>] operator[SEP] identifier[deviceMethods] operator[SEP] operator[SEP]
}
|
public static String getMacOsMajorVersion() {
if (!isMacOs()) {
return null;
}
String osVersion = System.getProperty("os.version");
if (osVersion != null) {
String[] split = osVersion.split("\\.");
if (split.length >= 2) {
return split[0] + "." + split[1];
} else {
return osVersion;
}
}
return null;
}
|
class class_name[name] begin[{]
method[getMacOsMajorVersion, return_type[type[String]], modifier[public static], parameter[]] begin[{]
if[call[.isMacOs, parameter[]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[String], osVersion]
if[binary_operation[member[.osVersion], !=, literal[null]]] begin[{]
local_variable[type[String], split]
if[binary_operation[member[split.length], >=, literal[2]]] begin[{]
return[binary_operation[binary_operation[member[.split], +, literal["."]], +, member[.split]]]
else begin[{]
return[member[.osVersion]]
end[}]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[getMacOsMajorVersion] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isMacOs] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[String] identifier[osVersion] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[osVersion] operator[!=] Other[null] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[split] operator[=] identifier[osVersion] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[split] operator[SEP] identifier[length] operator[>=] Other[2] operator[SEP] {
Keyword[return] identifier[split] operator[SEP] Other[0] operator[SEP] operator[+] literal[String] operator[+] identifier[split] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[osVersion] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public static ApiResponseSet<String> httpMessageToSet(int historyId, int historyType, HttpMessage msg) {
Map<String, String> map = new HashMap<>();
map.put("id", String.valueOf(historyId));
map.put("type", String.valueOf(historyType));
map.put("timestamp", String.valueOf(msg.getTimeSentMillis()));
map.put("rtt", String.valueOf(msg.getTimeElapsedMillis()));
map.put("cookieParams", msg.getCookieParamsAsString());
map.put("note", msg.getNote());
map.put("requestHeader", msg.getRequestHeader().toString());
map.put("requestBody", msg.getRequestBody().toString());
map.put("responseHeader", msg.getResponseHeader().toString());
if (HttpHeader.GZIP.equals(msg.getResponseHeader().getHeader(HttpHeader.CONTENT_ENCODING))) {
// Uncompress gziped content
try (ByteArrayInputStream bais = new ByteArrayInputStream(msg.getResponseBody().getBytes());
GZIPInputStream gis = new GZIPInputStream(bais);
InputStreamReader isr = new InputStreamReader(gis);
BufferedReader br = new BufferedReader(isr);) {
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = br.readLine()) != null) {
sb.append(line);
}
map.put("responseBody", sb.toString());
} catch (IOException e) {
LOGGER.error("Unable to uncompress gzip content: " + e.getMessage(), e);
map.put("responseBody", msg.getResponseBody().toString());
}
} else {
map.put("responseBody", msg.getResponseBody().toString());
}
List<String> tags = Collections.emptyList();
try {
tags = HistoryReference.getTags(historyId);
} catch (DatabaseException e) {
LOGGER.warn("Failed to obtain the tags for message with ID " + historyId, e);
}
return new HttpMessageResponseSet(map, tags);
}
|
class class_name[name] begin[{]
method[httpMessageToSet, return_type[type[ApiResponseSet]], modifier[public static], parameter[historyId, historyType, msg]] begin[{]
local_variable[type[Map], map]
call[map.put, parameter[literal["id"], call[String.valueOf, parameter[member[.historyId]]]]]
call[map.put, parameter[literal["type"], call[String.valueOf, parameter[member[.historyType]]]]]
call[map.put, parameter[literal["timestamp"], call[String.valueOf, parameter[call[msg.getTimeSentMillis, parameter[]]]]]]
call[map.put, parameter[literal["rtt"], call[String.valueOf, parameter[call[msg.getTimeElapsedMillis, parameter[]]]]]]
call[map.put, parameter[literal["cookieParams"], call[msg.getCookieParamsAsString, parameter[]]]]
call[map.put, parameter[literal["note"], call[msg.getNote, parameter[]]]]
call[map.put, parameter[literal["requestHeader"], call[msg.getRequestHeader, parameter[]]]]
call[map.put, parameter[literal["requestBody"], call[msg.getRequestBody, parameter[]]]]
call[map.put, parameter[literal["responseHeader"], call[msg.getResponseHeader, parameter[]]]]
if[call[HttpHeader.GZIP.equals, parameter[call[msg.getResponseHeader, parameter[]]]]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=br, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="responseBody"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to uncompress gzip content: "), 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=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="responseBody"), MethodInvocation(arguments=[], member=getResponseBody, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=bais, type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayInputStream, sub_type=None), value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getResponseBody, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[MethodInvocation(arguments=[], member=getBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None))), TryResource(annotations=[], modifiers=set(), name=gis, type=ReferenceType(arguments=None, dimensions=[], name=GZIPInputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=bais, 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=GZIPInputStream, sub_type=None))), TryResource(annotations=[], modifiers=set(), name=isr, type=ReferenceType(arguments=None, dimensions=[], name=InputStreamReader, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=gis, 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=InputStreamReader, sub_type=None))), TryResource(annotations=[], modifiers=set(), name=br, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=isr, 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=BufferedReader, sub_type=None)))])
else begin[{]
call[map.put, parameter[literal["responseBody"], call[msg.getResponseBody, parameter[]]]]
end[}]
local_variable[type[List], tags]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=historyId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTags, postfix_operators=[], prefix_operators=[], qualifier=HistoryReference, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to obtain the tags for message with ID "), operandr=MemberReference(member=historyId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DatabaseException']))], finally_block=None, label=None, resources=None)
return[ClassCreator(arguments=[MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tags, 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=HttpMessageResponseSet, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[ApiResponseSet] operator[<] identifier[String] operator[>] identifier[httpMessageToSet] operator[SEP] Keyword[int] identifier[historyId] , Keyword[int] identifier[historyType] , identifier[HttpMessage] identifier[msg] 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] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[historyId] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[historyType] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[msg] operator[SEP] identifier[getTimeSentMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[msg] operator[SEP] identifier[getTimeElapsedMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[msg] operator[SEP] identifier[getCookieParamsAsString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[msg] operator[SEP] identifier[getNote] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[msg] operator[SEP] identifier[getRequestHeader] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[msg] operator[SEP] identifier[getRequestBody] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[msg] operator[SEP] identifier[getResponseHeader] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[HttpHeader] operator[SEP] identifier[GZIP] operator[SEP] identifier[equals] operator[SEP] identifier[msg] operator[SEP] identifier[getResponseHeader] operator[SEP] operator[SEP] operator[SEP] identifier[getHeader] operator[SEP] identifier[HttpHeader] operator[SEP] identifier[CONTENT_ENCODING] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] operator[SEP] identifier[ByteArrayInputStream] identifier[bais] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[msg] operator[SEP] identifier[getResponseBody] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[GZIPInputStream] identifier[gis] operator[=] Keyword[new] identifier[GZIPInputStream] operator[SEP] identifier[bais] operator[SEP] operator[SEP] identifier[InputStreamReader] identifier[isr] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[gis] operator[SEP] operator[SEP] identifier[BufferedReader] identifier[br] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] identifier[isr] operator[SEP] operator[SEP] operator[SEP] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[line] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[br] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[SEP] operator[SEP]
}
identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[msg] operator[SEP] identifier[getResponseBody] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[msg] operator[SEP] identifier[getResponseBody] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[String] operator[>] identifier[tags] operator[=] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[tags] operator[=] identifier[HistoryReference] operator[SEP] identifier[getTags] operator[SEP] identifier[historyId] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DatabaseException] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[historyId] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[HttpMessageResponseSet] operator[SEP] identifier[map] , identifier[tags] operator[SEP] operator[SEP]
}
|
@Beta
public static <T, U, R> BiFunction<T, U, R> sf(final Object mutex, final BiFunction<T, U, R> biFunction) {
N.checkArgNotNull(mutex, "mutex");
N.checkArgNotNull(biFunction, "biFunction");
return new BiFunction<T, U, R>() {
@Override
public R apply(T t, U u) {
synchronized (mutex) {
return biFunction.apply(t, u);
}
}
};
}
|
class class_name[name] begin[{]
method[sf, return_type[type[BiFunction]], modifier[public static], parameter[mutex, biFunction]] begin[{]
call[N.checkArgNotNull, parameter[member[.mutex], literal["mutex"]]]
call[N.checkArgNotNull, parameter[member[.biFunction], literal["biFunction"]]]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[SynchronizedStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=biFunction, selectors=[], type_arguments=None), label=None)], label=None, lock=MemberReference(member=mutex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=u, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=None, name=BiFunction, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[Beta] Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[U] , identifier[R] operator[>] identifier[BiFunction] operator[<] identifier[T] , identifier[U] , identifier[R] operator[>] identifier[sf] operator[SEP] Keyword[final] identifier[Object] identifier[mutex] , Keyword[final] identifier[BiFunction] operator[<] identifier[T] , identifier[U] , identifier[R] operator[>] identifier[biFunction] operator[SEP] {
identifier[N] operator[SEP] identifier[checkArgNotNull] operator[SEP] identifier[mutex] , literal[String] operator[SEP] operator[SEP] identifier[N] operator[SEP] identifier[checkArgNotNull] operator[SEP] identifier[biFunction] , literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[BiFunction] operator[<] identifier[T] , identifier[U] , identifier[R] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[R] identifier[apply] operator[SEP] identifier[T] identifier[t] , identifier[U] identifier[u] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[mutex] operator[SEP] {
Keyword[return] identifier[biFunction] operator[SEP] identifier[apply] operator[SEP] identifier[t] , identifier[u] operator[SEP] operator[SEP]
}
}
} operator[SEP]
}
|
void setFolderNameState(String setFolderName) {
if (setFolderName == null) {
if (m_simpleFieldFolderName.getValue().isEmpty()) {
m_isFolderNameTouched = false;
return;
}
m_isFolderNameTouched = true;
} else {
m_autoSetFolderName = setFolderName;
}
}
|
class class_name[name] begin[{]
method[setFolderNameState, return_type[void], modifier[default], parameter[setFolderName]] begin[{]
if[binary_operation[member[.setFolderName], ==, literal[null]]] begin[{]
if[call[m_simpleFieldFolderName.getValue, parameter[]]] begin[{]
assign[member[.m_isFolderNameTouched], literal[false]]
return[None]
else begin[{]
None
end[}]
assign[member[.m_isFolderNameTouched], literal[true]]
else begin[{]
assign[member[.m_autoSetFolderName], member[.setFolderName]]
end[}]
end[}]
END[}]
|
Keyword[void] identifier[setFolderNameState] operator[SEP] identifier[String] identifier[setFolderName] operator[SEP] {
Keyword[if] operator[SEP] identifier[setFolderName] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_simpleFieldFolderName] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[m_isFolderNameTouched] operator[=] literal[boolean] operator[SEP] Keyword[return] operator[SEP]
}
identifier[m_isFolderNameTouched] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[m_autoSetFolderName] operator[=] identifier[setFolderName] operator[SEP]
}
}
|
static String getXADataSourceClassName(String vendorPropertiesPID) {
String[] classNames = classNamesByPID.get(vendorPropertiesPID);
return classNames == null ? null : classNames[2];
}
|
class class_name[name] begin[{]
method[getXADataSourceClassName, return_type[type[String]], modifier[static], parameter[vendorPropertiesPID]] begin[{]
local_variable[type[String], classNames]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=classNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=classNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}]
|
Keyword[static] identifier[String] identifier[getXADataSourceClassName] operator[SEP] identifier[String] identifier[vendorPropertiesPID] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[classNames] operator[=] identifier[classNamesByPID] operator[SEP] identifier[get] operator[SEP] identifier[vendorPropertiesPID] operator[SEP] operator[SEP] Keyword[return] identifier[classNames] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[classNames] operator[SEP] Other[2] operator[SEP] operator[SEP]
}
|
public Matrix add (final Matrix m) throws MatrixException
{
// Validate m's size.
if ((m_nRows != m.m_nRows) && (m_nCols != m.m_nCols))
{
throw new MatrixException (MatrixException.INVALID_DIMENSIONS);
}
final float sv[][] = new float [m_nRows] [m_nCols]; // sum values
// Compute values of the sum.
for (int r = 0; r < m_nRows; ++r)
{
for (int c = 0; c < m_nCols; ++c)
{
sv[r][c] = m_aValues[r][c] + m.m_aValues[r][c];
}
}
return new Matrix (sv);
}
|
class class_name[name] begin[{]
method[add, return_type[type[Matrix]], modifier[public], parameter[m]] begin[{]
if[binary_operation[binary_operation[member[.m_nRows], !=, member[m.m_nRows]], &&, binary_operation[member[.m_nCols], !=, member[m.m_nCols]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INVALID_DIMENSIONS, postfix_operators=[], prefix_operators=[], qualifier=MatrixException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MatrixException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[float], sv]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=m_aValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=m_aValues, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[ArraySelector(index=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m_nCols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m_nRows, 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=r)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=r, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
return[ClassCreator(arguments=[MemberReference(member=sv, 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=Matrix, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[Matrix] identifier[add] operator[SEP] Keyword[final] identifier[Matrix] identifier[m] operator[SEP] Keyword[throws] identifier[MatrixException] {
Keyword[if] operator[SEP] operator[SEP] identifier[m_nRows] operator[!=] identifier[m] operator[SEP] identifier[m_nRows] operator[SEP] operator[&&] operator[SEP] identifier[m_nCols] operator[!=] identifier[m] operator[SEP] identifier[m_nCols] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MatrixException] operator[SEP] identifier[MatrixException] operator[SEP] identifier[INVALID_DIMENSIONS] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[float] identifier[sv] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[float] operator[SEP] identifier[m_nRows] operator[SEP] operator[SEP] identifier[m_nCols] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[r] operator[=] Other[0] operator[SEP] identifier[r] operator[<] identifier[m_nRows] operator[SEP] operator[++] identifier[r] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] identifier[m_nCols] operator[SEP] operator[++] identifier[c] operator[SEP] {
identifier[sv] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[c] operator[SEP] operator[=] identifier[m_aValues] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[c] operator[SEP] operator[+] identifier[m] operator[SEP] identifier[m_aValues] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[Matrix] operator[SEP] identifier[sv] operator[SEP] operator[SEP]
}
|
void setPathUserIndex(int path, int index, int value) {
AttributeStreamOfInt32 stream = m_pathindices.get(index);
int pindex = getPathIndex_(path);
if (stream.size() < m_path_areas.size())
stream.resize(m_path_areas.size(), -1);
stream.write(pindex, value);
}
|
class class_name[name] begin[{]
method[setPathUserIndex, return_type[void], modifier[default], parameter[path, index, value]] begin[{]
local_variable[type[AttributeStreamOfInt32], stream]
local_variable[type[int], pindex]
if[binary_operation[call[stream.size, parameter[]], <, call[m_path_areas.size, parameter[]]]] begin[{]
call[stream.resize, parameter[call[m_path_areas.size, parameter[]], literal[1]]]
else begin[{]
None
end[}]
call[stream.write, parameter[member[.pindex], member[.value]]]
end[}]
END[}]
|
Keyword[void] identifier[setPathUserIndex] operator[SEP] Keyword[int] identifier[path] , Keyword[int] identifier[index] , Keyword[int] identifier[value] operator[SEP] {
identifier[AttributeStreamOfInt32] identifier[stream] operator[=] identifier[m_pathindices] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[int] identifier[pindex] operator[=] identifier[getPathIndex_] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stream] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[m_path_areas] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] identifier[resize] operator[SEP] identifier[m_path_areas] operator[SEP] identifier[size] operator[SEP] operator[SEP] , operator[-] Other[1] operator[SEP] operator[SEP] identifier[stream] operator[SEP] identifier[write] operator[SEP] identifier[pindex] , identifier[value] operator[SEP] operator[SEP]
}
|
public static PlannerBenchmarkFactory createFromXmlResource(String benchmarkConfigResource, ClassLoader classLoader) {
return new XStreamXmlPlannerBenchmarkFactory(new SolverConfigContext(classLoader))
.configure(benchmarkConfigResource);
}
|
class class_name[name] begin[{]
method[createFromXmlResource, return_type[type[PlannerBenchmarkFactory]], modifier[public static], parameter[benchmarkConfigResource, classLoader]] begin[{]
return[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=classLoader, 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=SolverConfigContext, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=benchmarkConfigResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=configure, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=XStreamXmlPlannerBenchmarkFactory, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[PlannerBenchmarkFactory] identifier[createFromXmlResource] operator[SEP] identifier[String] identifier[benchmarkConfigResource] , identifier[ClassLoader] identifier[classLoader] operator[SEP] {
Keyword[return] Keyword[new] identifier[XStreamXmlPlannerBenchmarkFactory] operator[SEP] Keyword[new] identifier[SolverConfigContext] operator[SEP] identifier[classLoader] operator[SEP] operator[SEP] operator[SEP] identifier[configure] operator[SEP] identifier[benchmarkConfigResource] operator[SEP] operator[SEP]
}
|
public static FSInfo instance(Context context) {
FSInfo instance = context.get(FSInfo.class);
if (instance == null)
instance = new FSInfo();
return instance;
}
|
class class_name[name] begin[{]
method[instance, return_type[type[FSInfo]], modifier[public static], parameter[context]] begin[{]
local_variable[type[FSInfo], instance]
if[binary_operation[member[.instance], ==, literal[null]]] begin[{]
assign[member[.instance], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FSInfo, sub_type=None))]
else begin[{]
None
end[}]
return[member[.instance]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[FSInfo] identifier[instance] operator[SEP] identifier[Context] identifier[context] operator[SEP] {
identifier[FSInfo] identifier[instance] operator[=] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[FSInfo] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[instance] operator[==] Other[null] operator[SEP] identifier[instance] operator[=] Keyword[new] identifier[FSInfo] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[instance] operator[SEP]
}
|
public static <T> void mergeFrom(byte[] data, T message, Schema<T> schema)
{
mergeFrom(data, 0, data.length, message, schema);
}
|
class class_name[name] begin[{]
method[mergeFrom, return_type[void], modifier[public static], parameter[data, message, schema]] begin[{]
call[.mergeFrom, parameter[member[.data], literal[0], member[data.length], member[.message], member[.schema]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[void] identifier[mergeFrom] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] , identifier[T] identifier[message] , identifier[Schema] operator[<] identifier[T] operator[>] identifier[schema] operator[SEP] {
identifier[mergeFrom] operator[SEP] identifier[data] , Other[0] , identifier[data] operator[SEP] identifier[length] , identifier[message] , identifier[schema] operator[SEP] operator[SEP]
}
|
public byte[] getQrcode(String ticket) {
String url = WxEndpoint.get("url.ticket.qrcode");
return wxClient.getBinary(String.format(url, URLEncoder.encode(ticket)), false);
}
|
class class_name[name] begin[{]
method[getQrcode, return_type[type[byte]], modifier[public], parameter[ticket]] begin[{]
local_variable[type[String], url]
return[call[wxClient.getBinary, parameter[call[String.format, parameter[member[.url], call[URLEncoder.encode, parameter[member[.ticket]]]]], literal[false]]]]
end[}]
END[}]
|
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[getQrcode] operator[SEP] identifier[String] identifier[ticket] operator[SEP] {
identifier[String] identifier[url] operator[=] identifier[WxEndpoint] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[wxClient] operator[SEP] identifier[getBinary] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[url] , identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[ticket] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP]
}
|
public Observable<RouteFilterInner> beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1<ServiceResponse<RouteFilterInner>, RouteFilterInner>() {
@Override
public RouteFilterInner call(ServiceResponse<RouteFilterInner> response) {
return response.body();
}
});
}
|
class class_name[name] begin[{]
method[beginUpdateAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, routeFilterName, routeFilterParameters]] begin[{]
return[call[.beginUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.routeFilterName], member[.routeFilterParameters]]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[RouteFilterInner] operator[>] identifier[beginUpdateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[routeFilterName] , identifier[PatchRouteFilter] identifier[routeFilterParameters] operator[SEP] {
Keyword[return] identifier[beginUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[routeFilterName] , identifier[routeFilterParameters] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[RouteFilterInner] operator[>] , identifier[RouteFilterInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[RouteFilterInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[RouteFilterInner] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public IResponse getResourceVersions(String resource) throws Exception {
String apiVer = changeToAPICall(resource) + "?version=all"; //$NON-NLS-1$
return getResourceInputStream(apiVer);
}
|
class class_name[name] begin[{]
method[getResourceVersions, return_type[type[IResponse]], modifier[public], parameter[resource]] begin[{]
local_variable[type[String], apiVer]
return[call[.getResourceInputStream, parameter[member[.apiVer]]]]
end[}]
END[}]
|
Keyword[public] identifier[IResponse] identifier[getResourceVersions] operator[SEP] identifier[String] identifier[resource] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[String] identifier[apiVer] operator[=] identifier[changeToAPICall] operator[SEP] identifier[resource] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[return] identifier[getResourceInputStream] operator[SEP] identifier[apiVer] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
public <E> List<E> upsert(List<E> entities) {
if (entities == null || entities.isEmpty()) {
return new ArrayList<>();
}
try {
entityManager.executeEntityListeners(CallbackType.PRE_UPSERT, entities);
FullEntity<?>[] nativeEntities = toNativeFullEntities(entities, entityManager, Intent.UPSERT);
Class<?> entityClass = entities.get(0).getClass();
List<Entity> upsertedNativeEntities = nativeWriter.put(nativeEntities);
List<E> upsertedEntities = (List<E>) toEntities(entityClass, upsertedNativeEntities);
entityManager.executeEntityListeners(CallbackType.POST_UPSERT, upsertedEntities);
return upsertedEntities;
} catch (DatastoreException exp) {
throw DatastoreUtils.wrap(exp);
}
}
|
class class_name[name] begin[{]
method[upsert, return_type[type[List]], modifier[public], parameter[entities]] begin[{]
if[binary_operation[binary_operation[member[.entities], ==, literal[null]], ||, call[entities.isEmpty, parameter[]]]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=PRE_UPSERT, postfix_operators=[], prefix_operators=[], qualifier=CallbackType, selectors=[]), MemberReference(member=entities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=executeEntityListeners, postfix_operators=[], prefix_operators=[], qualifier=entityManager, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=entities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=entityManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UPSERT, postfix_operators=[], prefix_operators=[], qualifier=Intent, selectors=[])], member=toNativeFullEntities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=nativeEntities)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[None], name=FullEntity, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=entities, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=entityClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nativeEntities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=nativeWriter, selectors=[], type_arguments=None), name=upsertedNativeEntities)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Entity, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=entityClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=upsertedNativeEntities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toEntities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=[], name=List, sub_type=None)), name=upsertedEntities)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=POST_UPSERT, postfix_operators=[], prefix_operators=[], qualifier=CallbackType, selectors=[]), MemberReference(member=upsertedEntities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=executeEntityListeners, postfix_operators=[], prefix_operators=[], qualifier=entityManager, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=upsertedEntities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=exp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=DatastoreUtils, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exp, types=['DatastoreException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[E] operator[>] identifier[List] operator[<] identifier[E] operator[>] identifier[upsert] operator[SEP] identifier[List] operator[<] identifier[E] operator[>] identifier[entities] operator[SEP] {
Keyword[if] operator[SEP] identifier[entities] operator[==] Other[null] operator[||] identifier[entities] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[entityManager] operator[SEP] identifier[executeEntityListeners] operator[SEP] identifier[CallbackType] operator[SEP] identifier[PRE_UPSERT] , identifier[entities] operator[SEP] operator[SEP] identifier[FullEntity] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[nativeEntities] operator[=] identifier[toNativeFullEntities] operator[SEP] identifier[entities] , identifier[entityManager] , identifier[Intent] operator[SEP] identifier[UPSERT] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[entityClass] operator[=] identifier[entities] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Entity] operator[>] identifier[upsertedNativeEntities] operator[=] identifier[nativeWriter] operator[SEP] identifier[put] operator[SEP] identifier[nativeEntities] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[E] operator[>] identifier[upsertedEntities] operator[=] operator[SEP] identifier[List] operator[<] identifier[E] operator[>] operator[SEP] identifier[toEntities] operator[SEP] identifier[entityClass] , identifier[upsertedNativeEntities] operator[SEP] operator[SEP] identifier[entityManager] operator[SEP] identifier[executeEntityListeners] operator[SEP] identifier[CallbackType] operator[SEP] identifier[POST_UPSERT] , identifier[upsertedEntities] operator[SEP] operator[SEP] Keyword[return] identifier[upsertedEntities] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DatastoreException] identifier[exp] operator[SEP] {
Keyword[throw] identifier[DatastoreUtils] operator[SEP] identifier[wrap] operator[SEP] identifier[exp] operator[SEP] operator[SEP]
}
}
|
public void execute() {
try {
createBundles();
} catch (Exception ex) {
Logger logger = Logger.getLogger(getClass().getName());
if(ex instanceof ServletException){
logger.log(Level.SEVERE, null, ((ServletException)ex).getRootCause());
}else{
logger.log(Level.SEVERE, null, ex);
}
}
}
|
class class_name[name] begin[{]
method[execute, return_type[void], modifier[public], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=createBundles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=Logger, selectors=[], type_arguments=None), name=logger)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Logger, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ServletException, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Cast(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ServletException, sub_type=None))], member=log, postfix_operators=[], prefix_operators=[], qualifier=logger, 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[execute] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[createBundles] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[Logger] identifier[logger] operator[=] identifier[Logger] operator[SEP] identifier[getLogger] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ex] Keyword[instanceof] identifier[ServletException] operator[SEP] {
identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , Other[null] , operator[SEP] operator[SEP] identifier[ServletException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] identifier[getRootCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , Other[null] , identifier[ex] operator[SEP] operator[SEP]
}
}
}
|
private void splitState(TTTTransition<I, D> transition, Word<I> tempDiscriminator, D oldOut, D newOut) {
assert !transition.isTree();
notifyPreSplit(transition, tempDiscriminator);
AbstractBaseDTNode<I, D> dtNode = transition.getNonTreeTarget();
assert dtNode.isLeaf();
TTTState<I, D> oldState = dtNode.getData();
assert oldState != null;
TTTState<I, D> newState = makeTree(transition);
AbstractBaseDTNode<I, D>.SplitResult children = split(dtNode, tempDiscriminator, oldOut, newOut);
dtNode.setTemp(true);
link(children.nodeOld, oldState);
link(children.nodeNew, newState);
if (dtNode.getParent() == null || !dtNode.getParent().isTemp()) {
blockList.insertBlock(dtNode);
}
notifyPostSplit(transition, tempDiscriminator);
}
|
class class_name[name] begin[{]
method[splitState, return_type[void], modifier[private], parameter[transition, tempDiscriminator, oldOut, newOut]] begin[{]
AssertStatement(condition=MethodInvocation(arguments=[], member=isTree, postfix_operators=[], prefix_operators=['!'], qualifier=transition, selectors=[], type_arguments=None), label=None, value=None)
call[.notifyPreSplit, parameter[member[.transition], member[.tempDiscriminator]]]
local_variable[type[AbstractBaseDTNode], dtNode]
AssertStatement(condition=MethodInvocation(arguments=[], member=isLeaf, postfix_operators=[], prefix_operators=[], qualifier=dtNode, selectors=[], type_arguments=None), label=None, value=None)
local_variable[type[TTTState], oldState]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=oldState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
local_variable[type[TTTState], newState]
local_variable[type[AbstractBaseDTNode], children]
call[dtNode.setTemp, parameter[literal[true]]]
call[.link, parameter[member[children.nodeOld], member[.oldState]]]
call[.link, parameter[member[children.nodeNew], member[.newState]]]
if[binary_operation[binary_operation[call[dtNode.getParent, parameter[]], ==, literal[null]], ||, call[dtNode.getParent, parameter[]]]] begin[{]
call[blockList.insertBlock, parameter[member[.dtNode]]]
else begin[{]
None
end[}]
call[.notifyPostSplit, parameter[member[.transition], member[.tempDiscriminator]]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[splitState] operator[SEP] identifier[TTTTransition] operator[<] identifier[I] , identifier[D] operator[>] identifier[transition] , identifier[Word] operator[<] identifier[I] operator[>] identifier[tempDiscriminator] , identifier[D] identifier[oldOut] , identifier[D] identifier[newOut] operator[SEP] {
Keyword[assert] operator[!] identifier[transition] operator[SEP] identifier[isTree] operator[SEP] operator[SEP] operator[SEP] identifier[notifyPreSplit] operator[SEP] identifier[transition] , identifier[tempDiscriminator] operator[SEP] operator[SEP] identifier[AbstractBaseDTNode] operator[<] identifier[I] , identifier[D] operator[>] identifier[dtNode] operator[=] identifier[transition] operator[SEP] identifier[getNonTreeTarget] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[dtNode] operator[SEP] identifier[isLeaf] operator[SEP] operator[SEP] operator[SEP] identifier[TTTState] operator[<] identifier[I] , identifier[D] operator[>] identifier[oldState] operator[=] identifier[dtNode] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[oldState] operator[!=] Other[null] operator[SEP] identifier[TTTState] operator[<] identifier[I] , identifier[D] operator[>] identifier[newState] operator[=] identifier[makeTree] operator[SEP] identifier[transition] operator[SEP] operator[SEP] identifier[AbstractBaseDTNode] operator[<] identifier[I] , identifier[D] operator[>] operator[SEP] identifier[SplitResult] identifier[children] operator[=] identifier[split] operator[SEP] identifier[dtNode] , identifier[tempDiscriminator] , identifier[oldOut] , identifier[newOut] operator[SEP] operator[SEP] identifier[dtNode] operator[SEP] identifier[setTemp] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[link] operator[SEP] identifier[children] operator[SEP] identifier[nodeOld] , identifier[oldState] operator[SEP] operator[SEP] identifier[link] operator[SEP] identifier[children] operator[SEP] identifier[nodeNew] , identifier[newState] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dtNode] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] operator[!] identifier[dtNode] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[isTemp] operator[SEP] operator[SEP] operator[SEP] {
identifier[blockList] operator[SEP] identifier[insertBlock] operator[SEP] identifier[dtNode] operator[SEP] operator[SEP]
}
identifier[notifyPostSplit] operator[SEP] identifier[transition] , identifier[tempDiscriminator] operator[SEP] operator[SEP]
}
|
protected void indexNode(int expandedTypeID, int identity)
{
ExpandedNameTable ent = m_expandedNameTable;
short type = ent.getType(expandedTypeID);
if (DTM.ELEMENT_NODE == type)
{
int namespaceID = ent.getNamespaceID(expandedTypeID);
int localNameID = ent.getLocalNameID(expandedTypeID);
ensureSizeOfIndex(namespaceID, localNameID);
int[] index = m_elemIndexes[namespaceID][localNameID];
index[index[0]] = identity;
index[0]++;
}
}
|
class class_name[name] begin[{]
method[indexNode, return_type[void], modifier[protected], parameter[expandedTypeID, identity]] begin[{]
local_variable[type[ExpandedNameTable], ent]
local_variable[type[short], type]
if[binary_operation[member[DTM.ELEMENT_NODE], ==, member[.type]]] begin[{]
local_variable[type[int], namespaceID]
local_variable[type[int], localNameID]
call[.ensureSizeOfIndex, parameter[member[.namespaceID], member[.localNameID]]]
local_variable[type[int], index]
assign[member[.index], member[.identity]]
member[.index]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[indexNode] operator[SEP] Keyword[int] identifier[expandedTypeID] , Keyword[int] identifier[identity] operator[SEP] {
identifier[ExpandedNameTable] identifier[ent] operator[=] identifier[m_expandedNameTable] operator[SEP] Keyword[short] identifier[type] operator[=] identifier[ent] operator[SEP] identifier[getType] operator[SEP] identifier[expandedTypeID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DTM] operator[SEP] identifier[ELEMENT_NODE] operator[==] identifier[type] operator[SEP] {
Keyword[int] identifier[namespaceID] operator[=] identifier[ent] operator[SEP] identifier[getNamespaceID] operator[SEP] identifier[expandedTypeID] operator[SEP] operator[SEP] Keyword[int] identifier[localNameID] operator[=] identifier[ent] operator[SEP] identifier[getLocalNameID] operator[SEP] identifier[expandedTypeID] operator[SEP] operator[SEP] identifier[ensureSizeOfIndex] operator[SEP] identifier[namespaceID] , identifier[localNameID] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[index] operator[=] identifier[m_elemIndexes] operator[SEP] identifier[namespaceID] operator[SEP] operator[SEP] identifier[localNameID] operator[SEP] operator[SEP] identifier[index] operator[SEP] identifier[index] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[=] identifier[identity] operator[SEP] identifier[index] operator[SEP] Other[0] operator[SEP] operator[++] operator[SEP]
}
}
|
public ComputeNodeDisableSchedulingOptions withOcpDate(DateTime ocpDate) {
if (ocpDate == null) {
this.ocpDate = null;
} else {
this.ocpDate = new DateTimeRfc1123(ocpDate);
}
return this;
}
|
class class_name[name] begin[{]
method[withOcpDate, return_type[type[ComputeNodeDisableSchedulingOptions]], modifier[public], parameter[ocpDate]] begin[{]
if[binary_operation[member[.ocpDate], ==, literal[null]]] begin[{]
assign[THIS[member[None.ocpDate]], literal[null]]
else begin[{]
assign[THIS[member[None.ocpDate]], ClassCreator(arguments=[MemberReference(member=ocpDate, 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=DateTimeRfc1123, sub_type=None))]
end[}]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[ComputeNodeDisableSchedulingOptions] identifier[withOcpDate] operator[SEP] identifier[DateTime] identifier[ocpDate] operator[SEP] {
Keyword[if] operator[SEP] identifier[ocpDate] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[ocpDate] operator[=] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[ocpDate] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static final Function<Collection<? extends Date>, Interval> dateFieldCollectionToInterval(DateTimeZone dateTimeZone) {
return FnInterval.dateFieldCollectionToInterval(dateTimeZone);
}
|
class class_name[name] begin[{]
method[dateFieldCollectionToInterval, return_type[type[Function]], modifier[final public static], parameter[dateTimeZone]] begin[{]
return[call[FnInterval.dateFieldCollectionToInterval, parameter[member[.dateTimeZone]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[final] identifier[Function] operator[<] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[Date] operator[>] , identifier[Interval] operator[>] identifier[dateFieldCollectionToInterval] operator[SEP] identifier[DateTimeZone] identifier[dateTimeZone] operator[SEP] {
Keyword[return] identifier[FnInterval] operator[SEP] identifier[dateFieldCollectionToInterval] operator[SEP] identifier[dateTimeZone] operator[SEP] operator[SEP]
}
|
@Override
public Object getProperty(String property) {
if (property.equals(PROPERTY_XMLDECL_VERSION)) {
return version;
} else if (property.equals(PROPERTY_XMLDECL_STANDALONE)) {
return standalone;
} else if (property.equals(PROPERTY_LOCATION)) {
return location != null ? location : reader.toString();
} else {
return null;
}
}
|
class class_name[name] begin[{]
method[getProperty, return_type[type[Object]], modifier[public], parameter[property]] begin[{]
if[call[property.equals, parameter[member[.PROPERTY_XMLDECL_VERSION]]]] begin[{]
return[member[.version]]
else begin[{]
if[call[property.equals, parameter[member[.PROPERTY_XMLDECL_STANDALONE]]]] begin[{]
return[member[.standalone]]
else begin[{]
if[call[property.equals, parameter[member[.PROPERTY_LOCATION]]]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), if_true=MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
else begin[{]
return[literal[null]]
end[}]
end[}]
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[getProperty] operator[SEP] identifier[String] identifier[property] operator[SEP] {
Keyword[if] operator[SEP] identifier[property] operator[SEP] identifier[equals] operator[SEP] identifier[PROPERTY_XMLDECL_VERSION] operator[SEP] operator[SEP] {
Keyword[return] identifier[version] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[property] operator[SEP] identifier[equals] operator[SEP] identifier[PROPERTY_XMLDECL_STANDALONE] operator[SEP] operator[SEP] {
Keyword[return] identifier[standalone] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[property] operator[SEP] identifier[equals] operator[SEP] identifier[PROPERTY_LOCATION] operator[SEP] operator[SEP] {
Keyword[return] identifier[location] operator[!=] Other[null] operator[?] identifier[location] operator[:] identifier[reader] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
|
public Download resumeDownload(PersistableDownload persistableDownload) {
assertParameterNotNull(persistableDownload,
"PausedDownload is mandatory to resume a download.");
GetObjectRequest request = new GetObjectRequest(
persistableDownload.getBucketName(), persistableDownload.getKey(),
persistableDownload.getVersionId());
if (persistableDownload.getRange() != null
&& persistableDownload.getRange().length == 2) {
long[] range = persistableDownload.getRange();
request.setRange(range[0], range[1]);
}
request.setRequesterPays(persistableDownload.isRequesterPays());
request.setResponseHeaders(persistableDownload.getResponseHeaders());
return doDownload(request, new File(persistableDownload.getFile()), null, null,
APPEND_MODE, 0,
persistableDownload);
}
|
class class_name[name] begin[{]
method[resumeDownload, return_type[type[Download]], modifier[public], parameter[persistableDownload]] begin[{]
call[.assertParameterNotNull, parameter[member[.persistableDownload], literal["PausedDownload is mandatory to resume a download."]]]
local_variable[type[GetObjectRequest], request]
if[binary_operation[binary_operation[call[persistableDownload.getRange, parameter[]], !=, literal[null]], &&, binary_operation[call[persistableDownload.getRange, parameter[]], ==, literal[2]]]] begin[{]
local_variable[type[long], range]
call[request.setRange, parameter[member[.range], member[.range]]]
else begin[{]
None
end[}]
call[request.setRequesterPays, parameter[call[persistableDownload.isRequesterPays, parameter[]]]]
call[request.setResponseHeaders, parameter[call[persistableDownload.getResponseHeaders, parameter[]]]]
return[call[.doDownload, parameter[member[.request], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=persistableDownload, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), literal[null], literal[null], member[.APPEND_MODE], literal[0], member[.persistableDownload]]]]
end[}]
END[}]
|
Keyword[public] identifier[Download] identifier[resumeDownload] operator[SEP] identifier[PersistableDownload] identifier[persistableDownload] operator[SEP] {
identifier[assertParameterNotNull] operator[SEP] identifier[persistableDownload] , literal[String] operator[SEP] operator[SEP] identifier[GetObjectRequest] identifier[request] operator[=] Keyword[new] identifier[GetObjectRequest] operator[SEP] identifier[persistableDownload] operator[SEP] identifier[getBucketName] operator[SEP] operator[SEP] , identifier[persistableDownload] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[persistableDownload] operator[SEP] identifier[getVersionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[persistableDownload] operator[SEP] identifier[getRange] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[persistableDownload] operator[SEP] identifier[getRange] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] {
Keyword[long] operator[SEP] operator[SEP] identifier[range] operator[=] identifier[persistableDownload] operator[SEP] identifier[getRange] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setRange] operator[SEP] identifier[range] operator[SEP] Other[0] operator[SEP] , identifier[range] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
identifier[request] operator[SEP] identifier[setRequesterPays] operator[SEP] identifier[persistableDownload] operator[SEP] identifier[isRequesterPays] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setResponseHeaders] operator[SEP] identifier[persistableDownload] operator[SEP] identifier[getResponseHeaders] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[doDownload] operator[SEP] identifier[request] , Keyword[new] identifier[File] operator[SEP] identifier[persistableDownload] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] , Other[null] , Other[null] , identifier[APPEND_MODE] , Other[0] , identifier[persistableDownload] operator[SEP] operator[SEP]
}
|
public void syncFilename(String fileName) {
if (emitLineDirectives) {
if (!fileName.equals(currentFile)) {
currentLine = BEGINNING_OF_FILE;
// C11 spec. (6.10.4) requires a line number between 1 and 2147483647.
buffer.append(UnicodeUtils.format("\n#line 1 \"%s\"\n", fileName));
}
}
currentFile = fileName;
}
|
class class_name[name] begin[{]
method[syncFilename, return_type[void], modifier[public], parameter[fileName]] begin[{]
if[member[.emitLineDirectives]] begin[{]
if[call[fileName.equals, parameter[member[.currentFile]]]] begin[{]
assign[member[.currentLine], member[.BEGINNING_OF_FILE]]
call[buffer.append, parameter[call[UnicodeUtils.format, parameter[literal["\n#line 1 \"%s\"\n"], member[.fileName]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
assign[member[.currentFile], member[.fileName]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[syncFilename] operator[SEP] identifier[String] identifier[fileName] operator[SEP] {
Keyword[if] operator[SEP] identifier[emitLineDirectives] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[fileName] operator[SEP] identifier[equals] operator[SEP] identifier[currentFile] operator[SEP] operator[SEP] {
identifier[currentLine] operator[=] identifier[BEGINNING_OF_FILE] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[UnicodeUtils] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[fileName] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[currentFile] operator[=] identifier[fileName] operator[SEP]
}
|
public void setImage(I image, D derivX, D derivY) {
InputSanityCheck.checkSameShape(image, derivX, derivY);
this.image = image;
this.interpInput.setImage(image);
this.derivX = derivX;
this.derivY = derivY;
}
|
class class_name[name] begin[{]
method[setImage, return_type[void], modifier[public], parameter[image, derivX, derivY]] begin[{]
call[InputSanityCheck.checkSameShape, parameter[member[.image], member[.derivX], member[.derivY]]]
assign[THIS[member[None.image]], member[.image]]
THIS[member[None.interpInput]call[None.setImage, parameter[member[.image]]]]
assign[THIS[member[None.derivX]], member[.derivX]]
assign[THIS[member[None.derivY]], member[.derivY]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setImage] operator[SEP] identifier[I] identifier[image] , identifier[D] identifier[derivX] , identifier[D] identifier[derivY] operator[SEP] {
identifier[InputSanityCheck] operator[SEP] identifier[checkSameShape] operator[SEP] identifier[image] , identifier[derivX] , identifier[derivY] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[image] operator[=] identifier[image] operator[SEP] Keyword[this] operator[SEP] identifier[interpInput] operator[SEP] identifier[setImage] operator[SEP] identifier[image] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[derivX] operator[=] identifier[derivX] operator[SEP] Keyword[this] operator[SEP] identifier[derivY] operator[=] identifier[derivY] operator[SEP]
}
|
protected void processInput(String input) {
String command = input.trim();
if (!command.isEmpty()) {
runCommand(command);
}
}
|
class class_name[name] begin[{]
method[processInput, return_type[void], modifier[protected], parameter[input]] begin[{]
local_variable[type[String], command]
if[call[command.isEmpty, parameter[]]] begin[{]
call[.runCommand, parameter[member[.command]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[processInput] operator[SEP] identifier[String] identifier[input] operator[SEP] {
identifier[String] identifier[command] operator[=] identifier[input] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[command] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[runCommand] operator[SEP] identifier[command] operator[SEP] operator[SEP]
}
}
|
public CreateWaterMarkResponse createWaterMark(CreateWaterMarkRequest request) {
checkStringNotEmpty(request.getBucket(), "The parameter bucket should NOT be null or empty string.");
checkStringNotEmpty(request.getKey(), "The parameter key should NOT be null or empty string.");
InternalRequest internalRequest = createRequest(HttpMethodName.POST, request, WATER_MARK);
return invokeHttpClient(internalRequest, CreateWaterMarkResponse.class);
}
|
class class_name[name] begin[{]
method[createWaterMark, return_type[type[CreateWaterMarkResponse]], modifier[public], parameter[request]] begin[{]
call[.checkStringNotEmpty, parameter[call[request.getBucket, parameter[]], literal["The parameter bucket should NOT be null or empty string."]]]
call[.checkStringNotEmpty, parameter[call[request.getKey, parameter[]], literal["The parameter key should NOT be null or empty string."]]]
local_variable[type[InternalRequest], internalRequest]
return[call[.invokeHttpClient, parameter[member[.internalRequest], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CreateWaterMarkResponse, sub_type=None))]]]
end[}]
END[}]
|
Keyword[public] identifier[CreateWaterMarkResponse] identifier[createWaterMark] operator[SEP] identifier[CreateWaterMarkRequest] identifier[request] operator[SEP] {
identifier[checkStringNotEmpty] operator[SEP] identifier[request] operator[SEP] identifier[getBucket] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[checkStringNotEmpty] operator[SEP] identifier[request] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[InternalRequest] identifier[internalRequest] operator[=] identifier[createRequest] operator[SEP] identifier[HttpMethodName] operator[SEP] identifier[POST] , identifier[request] , identifier[WATER_MARK] operator[SEP] operator[SEP] Keyword[return] identifier[invokeHttpClient] operator[SEP] identifier[internalRequest] , identifier[CreateWaterMarkResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public Iterator<Compound> toRootOrder(final Compound c) {
return new Iterator<Compound>() {
Compound curr;
TreeNode n = node(c);
Compound parent = c;
public boolean hasNext() {
return !n.isRoot();
}
public Compound next() {
if (hasNext()) {
curr = parent;
parent = n.parent;
n = node(n.parent);
return curr;
} else {
throw new NoSuchElementException();
}
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
|
class class_name[name] begin[{]
method[toRootOrder, return_type[type[Iterator]], modifier[public], parameter[c]] begin[{]
return[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=curr)], documentation=None, modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Compound, sub_type=None)), FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=n)], documentation=None, modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TreeNode, sub_type=None)), FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=parent)], documentation=None, modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Compound, sub_type=None)), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isRoot, postfix_operators=[], prefix_operators=['!'], qualifier=n, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[IfStatement(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchElementException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=curr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[])], member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=MemberReference(member=curr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], documentation=None, modifiers={'public'}, name=next, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Compound, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=remove, parameters=[], 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=Compound, sub_type=None))], dimensions=None, name=Iterator, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[Iterator] operator[<] identifier[Compound] operator[>] identifier[toRootOrder] operator[SEP] Keyword[final] identifier[Compound] identifier[c] operator[SEP] {
Keyword[return] Keyword[new] identifier[Iterator] operator[<] identifier[Compound] operator[>] operator[SEP] operator[SEP] {
identifier[Compound] identifier[curr] operator[SEP] identifier[TreeNode] identifier[n] operator[=] identifier[node] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[Compound] identifier[parent] operator[=] identifier[c] operator[SEP] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] {
Keyword[return] operator[!] identifier[n] operator[SEP] identifier[isRoot] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] identifier[Compound] identifier[next] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[curr] operator[=] identifier[parent] operator[SEP] identifier[parent] operator[=] identifier[n] operator[SEP] identifier[parent] operator[SEP] identifier[n] operator[=] identifier[node] operator[SEP] identifier[n] operator[SEP] identifier[parent] operator[SEP] operator[SEP] Keyword[return] identifier[curr] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[NoSuchElementException] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[public] Keyword[void] identifier[remove] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
protected void logMultipleMappingFailedForField(String facebookFieldName,
FieldWithAnnotation<Facebook> fieldWithAnnotation, String json) {
if (!MAPPER_LOGGER.isTraceEnabled()) {
return;
}
Field field = fieldWithAnnotation.getField();
MAPPER_LOGGER.trace(
"Could not map '{}' to {}. {}, but continuing on because '{}"
+ "' is mapped to multiple fields in {}. JSON is {}",
facebookFieldName, field.getDeclaringClass().getSimpleName(), field.getName(), facebookFieldName,
field.getDeclaringClass().getSimpleName(), json);
}
|
class class_name[name] begin[{]
method[logMultipleMappingFailedForField, return_type[void], modifier[protected], parameter[facebookFieldName, fieldWithAnnotation, json]] begin[{]
if[call[MAPPER_LOGGER.isTraceEnabled, parameter[]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[Field], field]
call[MAPPER_LOGGER.trace, parameter[binary_operation[literal["Could not map '{}' to {}. {}, but continuing on because '{}"], +, literal["' is mapped to multiple fields in {}. JSON is {}"]], member[.facebookFieldName], call[field.getDeclaringClass, parameter[]], call[field.getName, parameter[]], member[.facebookFieldName], call[field.getDeclaringClass, parameter[]], member[.json]]]
end[}]
END[}]
|
Keyword[protected] Keyword[void] identifier[logMultipleMappingFailedForField] operator[SEP] identifier[String] identifier[facebookFieldName] , identifier[FieldWithAnnotation] operator[<] identifier[Facebook] operator[>] identifier[fieldWithAnnotation] , identifier[String] identifier[json] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[MAPPER_LOGGER] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[Field] identifier[field] operator[=] identifier[fieldWithAnnotation] operator[SEP] identifier[getField] operator[SEP] operator[SEP] operator[SEP] identifier[MAPPER_LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] literal[String] , identifier[facebookFieldName] , identifier[field] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[facebookFieldName] , identifier[field] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[json] operator[SEP] operator[SEP]
}
|
public Map<String, String> toMap(){
Map<String, String> ret = new HashMap<>();
ret.put("id", this.getID());
ret.put("version", this.getVersion().toString());
return ret;
}
|
class class_name[name] begin[{]
method[toMap, return_type[type[Map]], modifier[public], parameter[]] begin[{]
local_variable[type[Map], ret]
call[ret.put, parameter[literal["id"], THIS[call[None.getID, parameter[]]]]]
call[ret.put, parameter[literal["version"], THIS[call[None.getVersion, parameter[]]call[None.toString, parameter[]]]]]
return[member[.ret]]
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[ret] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP]
}
|
private String getDefaultVersion(Set<String> keys, String appName) {
SortedSet<String> listOfApps = new TreeSet<String>();
for (String key : keys) {
if (key.split(":")[0].contentEquals(appName)) {
listOfApps.add(key);
}
}
return listOfApps.size() > 0 ? listOfApps.last() : null;
}
|
class class_name[name] begin[{]
method[getDefaultVersion, return_type[type[String]], modifier[private], parameter[keys, appName]] begin[{]
local_variable[type[SortedSet], listOfApps]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":")], member=split, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[MemberReference(member=appName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contentEquals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=listOfApps, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=listOfApps, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=last, postfix_operators=[], prefix_operators=[], qualifier=listOfApps, selectors=[], type_arguments=None))]
end[}]
END[}]
|
Keyword[private] identifier[String] identifier[getDefaultVersion] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[keys] , identifier[String] identifier[appName] operator[SEP] {
identifier[SortedSet] operator[<] identifier[String] operator[>] identifier[listOfApps] operator[=] Keyword[new] identifier[TreeSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[keys] operator[SEP] {
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[contentEquals] operator[SEP] identifier[appName] operator[SEP] operator[SEP] {
identifier[listOfApps] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[listOfApps] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[?] identifier[listOfApps] operator[SEP] identifier[last] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP]
}
|
public void setDateTimeRangeTargeting(com.google.api.ads.admanager.axis.v201902.DateTimeRangeTargeting dateTimeRangeTargeting) {
this.dateTimeRangeTargeting = dateTimeRangeTargeting;
}
|
class class_name[name] begin[{]
method[setDateTimeRangeTargeting, return_type[void], modifier[public], parameter[dateTimeRangeTargeting]] begin[{]
assign[THIS[member[None.dateTimeRangeTargeting]], member[.dateTimeRangeTargeting]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setDateTimeRangeTargeting] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201902] operator[SEP] identifier[DateTimeRangeTargeting] identifier[dateTimeRangeTargeting] operator[SEP] {
Keyword[this] operator[SEP] identifier[dateTimeRangeTargeting] operator[=] identifier[dateTimeRangeTargeting] operator[SEP]
}
|
public BigDecimal getBigDecimal(int index) {
Object found = content.get(index);
if (found == null) {
return null;
} else if (found instanceof Double) {
return new BigDecimal((Double) found);
}
return (BigDecimal) found;
}
|
class class_name[name] begin[{]
method[getBigDecimal, return_type[type[BigDecimal]], modifier[public], parameter[index]] begin[{]
local_variable[type[Object], found]
if[binary_operation[member[.found], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
if[binary_operation[member[.found], instanceof, type[Double]]] begin[{]
return[ClassCreator(arguments=[Cast(expression=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))]
else begin[{]
None
end[}]
end[}]
return[Cast(expression=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None))]
end[}]
END[}]
|
Keyword[public] identifier[BigDecimal] identifier[getBigDecimal] operator[SEP] Keyword[int] identifier[index] operator[SEP] {
identifier[Object] identifier[found] operator[=] identifier[content] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[found] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[found] Keyword[instanceof] identifier[Double] operator[SEP] {
Keyword[return] Keyword[new] identifier[BigDecimal] operator[SEP] operator[SEP] identifier[Double] operator[SEP] identifier[found] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[found] operator[SEP]
}
|
@Override
protected UniversalIdIntQueueMessage readFromQueueStorage(Connection conn) {
Map<String, Object> dbRow = getJdbcHelper().executeSelectOne(conn, SQL_READ_FROM_QUEUE);
if (dbRow != null) {
UniversalIdIntQueueMessage msg = new UniversalIdIntQueueMessage();
return msg.fromMap(dbRow);
}
return null;
}
|
class class_name[name] begin[{]
method[readFromQueueStorage, return_type[type[UniversalIdIntQueueMessage]], modifier[protected], parameter[conn]] begin[{]
local_variable[type[Map], dbRow]
if[binary_operation[member[.dbRow], !=, literal[null]]] begin[{]
local_variable[type[UniversalIdIntQueueMessage], msg]
return[call[msg.fromMap, parameter[member[.dbRow]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[protected] identifier[UniversalIdIntQueueMessage] identifier[readFromQueueStorage] operator[SEP] identifier[Connection] identifier[conn] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[dbRow] operator[=] identifier[getJdbcHelper] operator[SEP] operator[SEP] operator[SEP] identifier[executeSelectOne] operator[SEP] identifier[conn] , identifier[SQL_READ_FROM_QUEUE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dbRow] operator[!=] Other[null] operator[SEP] {
identifier[UniversalIdIntQueueMessage] identifier[msg] operator[=] Keyword[new] identifier[UniversalIdIntQueueMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[msg] operator[SEP] identifier[fromMap] operator[SEP] identifier[dbRow] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public void clearWorldClip() {
predraw();
worldClipRecord = null;
GL.glDisable(SGL.GL_CLIP_PLANE0);
GL.glDisable(SGL.GL_CLIP_PLANE1);
GL.glDisable(SGL.GL_CLIP_PLANE2);
GL.glDisable(SGL.GL_CLIP_PLANE3);
postdraw();
}
|
class class_name[name] begin[{]
method[clearWorldClip, return_type[void], modifier[public], parameter[]] begin[{]
call[.predraw, parameter[]]
assign[member[.worldClipRecord], literal[null]]
call[GL.glDisable, parameter[member[SGL.GL_CLIP_PLANE0]]]
call[GL.glDisable, parameter[member[SGL.GL_CLIP_PLANE1]]]
call[GL.glDisable, parameter[member[SGL.GL_CLIP_PLANE2]]]
call[GL.glDisable, parameter[member[SGL.GL_CLIP_PLANE3]]]
call[.postdraw, parameter[]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[clearWorldClip] operator[SEP] operator[SEP] {
identifier[predraw] operator[SEP] operator[SEP] operator[SEP] identifier[worldClipRecord] operator[=] Other[null] operator[SEP] identifier[GL] operator[SEP] identifier[glDisable] operator[SEP] identifier[SGL] operator[SEP] identifier[GL_CLIP_PLANE0] operator[SEP] operator[SEP] identifier[GL] operator[SEP] identifier[glDisable] operator[SEP] identifier[SGL] operator[SEP] identifier[GL_CLIP_PLANE1] operator[SEP] operator[SEP] identifier[GL] operator[SEP] identifier[glDisable] operator[SEP] identifier[SGL] operator[SEP] identifier[GL_CLIP_PLANE2] operator[SEP] operator[SEP] identifier[GL] operator[SEP] identifier[glDisable] operator[SEP] identifier[SGL] operator[SEP] identifier[GL_CLIP_PLANE3] operator[SEP] operator[SEP] identifier[postdraw] operator[SEP] operator[SEP] operator[SEP]
}
|
public ApiResponse<CharacterClonesResponse> getCharactersCharacterIdClonesWithHttpInfo(Integer characterId,
String datasource, String ifNoneMatch, String token) throws ApiException {
com.squareup.okhttp.Call call = getCharactersCharacterIdClonesValidateBeforeCall(characterId, datasource,
ifNoneMatch, token, null);
Type localVarReturnType = new TypeToken<CharacterClonesResponse>() {
}.getType();
return apiClient.execute(call, localVarReturnType);
}
|
class class_name[name] begin[{]
method[getCharactersCharacterIdClonesWithHttpInfo, return_type[type[ApiResponse]], modifier[public], parameter[characterId, datasource, ifNoneMatch, token]] begin[{]
local_variable[type[com], call]
local_variable[type[Type], localVarReturnType]
return[call[apiClient.execute, parameter[member[.call], member[.localVarReturnType]]]]
end[}]
END[}]
|
Keyword[public] identifier[ApiResponse] operator[<] identifier[CharacterClonesResponse] operator[>] identifier[getCharactersCharacterIdClonesWithHttpInfo] operator[SEP] identifier[Integer] identifier[characterId] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[ApiException] {
identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[getCharactersCharacterIdClonesValidateBeforeCall] operator[SEP] identifier[characterId] , identifier[datasource] , identifier[ifNoneMatch] , identifier[token] , Other[null] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[CharacterClonesResponse] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[apiClient] operator[SEP] identifier[execute] operator[SEP] identifier[call] , identifier[localVarReturnType] operator[SEP] operator[SEP]
}
|
public static String getHost(final URI uri) throws NormalizationException {
final String host = Strings.emptyToNull(uri.getHost());
if (host == null) {
throw new NormalizationException(uri.toString(), "No host in URI");
}
return host;
}
|
class class_name[name] begin[{]
method[getHost, return_type[type[String]], modifier[public static], parameter[uri]] begin[{]
local_variable[type[String], host]
if[binary_operation[member[.host], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No host in URI")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NormalizationException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.host]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[getHost] operator[SEP] Keyword[final] identifier[URI] identifier[uri] operator[SEP] Keyword[throws] identifier[NormalizationException] {
Keyword[final] identifier[String] identifier[host] operator[=] identifier[Strings] operator[SEP] identifier[emptyToNull] operator[SEP] identifier[uri] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[host] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NormalizationException] operator[SEP] identifier[uri] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[host] operator[SEP]
}
|
@SuppressWarnings({ "unchecked", "rawtypes" })
public <T> void set(PreparedStatement stmt, Path<?> path, int i, T value) throws SQLException {
if (value == null || value instanceof Null) {
Integer sqlType = null;
if (path != null) {
ColumnMetadata columnMetadata = ColumnMetadata.getColumnMetadata(path);
if (columnMetadata.hasJdbcType()) {
sqlType = columnMetadata.getJdbcType();
}
}
if (sqlType != null) {
stmt.setNull(i, sqlType);
} else {
stmt.setNull(i, Types.NULL);
}
} else {
getType(path, (Class) value.getClass()).setValue(stmt, i, value);
}
}
|
class class_name[name] begin[{]
method[set, return_type[void], modifier[public], parameter[stmt, path, i, value]] begin[{]
if[binary_operation[binary_operation[member[.value], ==, literal[null]], ||, binary_operation[member[.value], instanceof, type[Null]]]] begin[{]
local_variable[type[Integer], sqlType]
if[binary_operation[member[.path], !=, literal[null]]] begin[{]
local_variable[type[ColumnMetadata], columnMetadata]
if[call[columnMetadata.hasJdbcType, parameter[]]] begin[{]
assign[member[.sqlType], call[columnMetadata.getJdbcType, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.sqlType], !=, literal[null]]] begin[{]
call[stmt.setNull, parameter[member[.i], member[.sqlType]]]
else begin[{]
call[stmt.setNull, parameter[member[.i], member[Types.NULL]]]
end[}]
else begin[{]
call[.getType, parameter[member[.path], Cast(expression=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None))]]
end[}]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] Keyword[public] operator[<] identifier[T] operator[>] Keyword[void] identifier[set] operator[SEP] identifier[PreparedStatement] identifier[stmt] , identifier[Path] operator[<] operator[?] operator[>] identifier[path] , Keyword[int] identifier[i] , identifier[T] identifier[value] operator[SEP] Keyword[throws] identifier[SQLException] {
Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[||] identifier[value] Keyword[instanceof] identifier[Null] operator[SEP] {
identifier[Integer] identifier[sqlType] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[!=] Other[null] operator[SEP] {
identifier[ColumnMetadata] identifier[columnMetadata] operator[=] identifier[ColumnMetadata] operator[SEP] identifier[getColumnMetadata] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[columnMetadata] operator[SEP] identifier[hasJdbcType] operator[SEP] operator[SEP] operator[SEP] {
identifier[sqlType] operator[=] identifier[columnMetadata] operator[SEP] identifier[getJdbcType] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[sqlType] operator[!=] Other[null] operator[SEP] {
identifier[stmt] operator[SEP] identifier[setNull] operator[SEP] identifier[i] , identifier[sqlType] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[stmt] operator[SEP] identifier[setNull] operator[SEP] identifier[i] , identifier[Types] operator[SEP] identifier[NULL] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[getType] operator[SEP] identifier[path] , operator[SEP] identifier[Class] operator[SEP] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[stmt] , identifier[i] , identifier[value] operator[SEP] operator[SEP]
}
}
|
public <T> void sort( T[] array ) {
if ( array == null || array.length == 0 ) {
return;
}
Object item = array[0];
Map<String, FieldAccess> fields = BeanUtils.getFieldsFromObject( item );
Arrays.sort( array, this.comparator( fields ) );
}
|
class class_name[name] begin[{]
method[sort, return_type[void], modifier[public], parameter[array]] begin[{]
if[binary_operation[binary_operation[member[.array], ==, literal[null]], ||, binary_operation[member[array.length], ==, literal[0]]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[Object], item]
local_variable[type[Map], fields]
call[Arrays.sort, parameter[member[.array], THIS[call[None.comparator, parameter[member[.fields]]]]]]
end[}]
END[}]
|
Keyword[public] operator[<] identifier[T] operator[>] Keyword[void] identifier[sort] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[array] operator[SEP] {
Keyword[if] operator[SEP] identifier[array] operator[==] Other[null] operator[||] identifier[array] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[Object] identifier[item] operator[=] identifier[array] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[FieldAccess] operator[>] identifier[fields] operator[=] identifier[BeanUtils] operator[SEP] identifier[getFieldsFromObject] operator[SEP] identifier[item] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[array] , Keyword[this] operator[SEP] identifier[comparator] operator[SEP] identifier[fields] operator[SEP] operator[SEP] operator[SEP]
}
|
private Set<Tuple> toEdgeSet(int[] mapping) {
Set<Tuple> edges = new HashSet<Tuple>(mapping.length * 2);
for (int u = 0; u < g.length; u++) {
for (int v : g[u]) {
edges.add(new Tuple(mapping[u], mapping[v]));
}
}
return edges;
}
|
class class_name[name] begin[{]
method[toEdgeSet, return_type[type[Set]], modifier[private], parameter[mapping]] begin[{]
local_variable[type[Set], edges]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=mapping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=mapping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=v, 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=Tuple, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=edges, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=v)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=u)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=u, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.edges]]
end[}]
END[}]
|
Keyword[private] identifier[Set] operator[<] identifier[Tuple] operator[>] identifier[toEdgeSet] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[mapping] operator[SEP] {
identifier[Set] operator[<] identifier[Tuple] operator[>] identifier[edges] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Tuple] operator[>] operator[SEP] identifier[mapping] operator[SEP] identifier[length] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[u] operator[=] Other[0] operator[SEP] identifier[u] operator[<] identifier[g] operator[SEP] identifier[length] operator[SEP] identifier[u] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[v] operator[:] identifier[g] operator[SEP] identifier[u] operator[SEP] operator[SEP] {
identifier[edges] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Tuple] operator[SEP] identifier[mapping] operator[SEP] identifier[u] operator[SEP] , identifier[mapping] operator[SEP] identifier[v] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[edges] operator[SEP]
}
|
boolean isEntrySnoozed(NotificationEntry entry, PortletRequest req) {
// An id is required for hide behavior
if (StringUtils.isBlank(entry.getId())) {
return false;
}
boolean rslt = false; // default (clearly)
final long snoozeDurationMillis = calculateHideDurationMillis(entry, req);
// An entry with a negative snooze duration cannot be snoozed
if (snoozeDurationMillis > HideNotificationServiceDecorator.HIDE_DURATION_NONE) {
final JpaServices jpaServices = (JpaServices) SpringContext.getApplicationContext().getBean("jpaServices");
final List<EventDTO> history = jpaServices.getHistory(entry, req.getRemoteUser());
logger.debug("List<EventDTO> within getNotificationsBySourceAndCustomAttribute contains {} elements", history.size());
// Review the history...
for (EventDTO event : history) {
switch (event.getState()) {
case SNOOZED:
logger.debug("Found a SNOOZED event: {}", event);
// Nice, but it only counts if it isn't expired...
if (event.getTimestamp().getTime() + snoozeDurationMillis > System.currentTimeMillis()) {
rslt = true;
}
break;
case ISSUED:
logger.debug("Found an ISSUED event: {}", event);
// Re-issuing a notification un-snoozes it...
rslt = false;
break;
default:
// We don't care about any other events in the SNOOZED evaluation...
break;
}
}
}
logger.debug("Returning SNOOZED='{}' for the following notification: {}", rslt, entry);
return rslt;
}
|
class class_name[name] begin[{]
method[isEntrySnoozed, return_type[type[boolean]], modifier[default], parameter[entry, req]] begin[{]
if[call[StringUtils.isBlank, parameter[call[entry.getId, parameter[]]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[boolean], rslt]
local_variable[type[long], snoozeDurationMillis]
if[binary_operation[member[.snoozeDurationMillis], >, member[HideNotificationServiceDecorator.HIDE_DURATION_NONE]]] begin[{]
local_variable[type[JpaServices], jpaServices]
local_variable[type[List], history]
call[logger.debug, parameter[literal["List<EventDTO> within getNotificationsBySourceAndCustomAttribute contains {} elements"], call[history.size, parameter[]]]]
ForStatement(body=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=['SNOOZED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Found a SNOOZED event: {}"), MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTimestamp, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=snoozeDurationMillis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rslt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ISSUED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Found an ISSUED event: {}"), MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rslt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=history, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=event)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EventDTO, sub_type=None))), label=None)
else begin[{]
None
end[}]
call[logger.debug, parameter[literal["Returning SNOOZED='{}' for the following notification: {}"], member[.rslt], member[.entry]]]
return[member[.rslt]]
end[}]
END[}]
|
Keyword[boolean] identifier[isEntrySnoozed] operator[SEP] identifier[NotificationEntry] identifier[entry] , identifier[PortletRequest] identifier[req] operator[SEP] {
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[entry] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[boolean] identifier[rslt] operator[=] literal[boolean] operator[SEP] Keyword[final] Keyword[long] identifier[snoozeDurationMillis] operator[=] identifier[calculateHideDurationMillis] operator[SEP] identifier[entry] , identifier[req] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[snoozeDurationMillis] operator[>] identifier[HideNotificationServiceDecorator] operator[SEP] identifier[HIDE_DURATION_NONE] operator[SEP] {
Keyword[final] identifier[JpaServices] identifier[jpaServices] operator[=] operator[SEP] identifier[JpaServices] operator[SEP] identifier[SpringContext] operator[SEP] identifier[getApplicationContext] operator[SEP] operator[SEP] operator[SEP] identifier[getBean] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[EventDTO] operator[>] identifier[history] operator[=] identifier[jpaServices] operator[SEP] identifier[getHistory] operator[SEP] identifier[entry] , identifier[req] operator[SEP] identifier[getRemoteUser] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[history] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[EventDTO] identifier[event] operator[:] identifier[history] operator[SEP] {
Keyword[switch] operator[SEP] identifier[event] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[SNOOZED] operator[:] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[event] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[getTimestamp] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[+] identifier[snoozeDurationMillis] operator[>] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] {
identifier[rslt] operator[=] literal[boolean] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[ISSUED] operator[:] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[event] operator[SEP] operator[SEP] identifier[rslt] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP]
}
}
}
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[rslt] , identifier[entry] operator[SEP] operator[SEP] Keyword[return] identifier[rslt] operator[SEP]
}
|
public void marshall(OrcSerDe orcSerDe, ProtocolMarshaller protocolMarshaller) {
if (orcSerDe == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(orcSerDe.getStripeSizeBytes(), STRIPESIZEBYTES_BINDING);
protocolMarshaller.marshall(orcSerDe.getBlockSizeBytes(), BLOCKSIZEBYTES_BINDING);
protocolMarshaller.marshall(orcSerDe.getRowIndexStride(), ROWINDEXSTRIDE_BINDING);
protocolMarshaller.marshall(orcSerDe.getEnablePadding(), ENABLEPADDING_BINDING);
protocolMarshaller.marshall(orcSerDe.getPaddingTolerance(), PADDINGTOLERANCE_BINDING);
protocolMarshaller.marshall(orcSerDe.getCompression(), COMPRESSION_BINDING);
protocolMarshaller.marshall(orcSerDe.getBloomFilterColumns(), BLOOMFILTERCOLUMNS_BINDING);
protocolMarshaller.marshall(orcSerDe.getBloomFilterFalsePositiveProbability(), BLOOMFILTERFALSEPOSITIVEPROBABILITY_BINDING);
protocolMarshaller.marshall(orcSerDe.getDictionaryKeyThreshold(), DICTIONARYKEYTHRESHOLD_BINDING);
protocolMarshaller.marshall(orcSerDe.getFormatVersion(), FORMATVERSION_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[orcSerDe, protocolMarshaller]] begin[{]
if[binary_operation[member[.orcSerDe], ==, 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=getStripeSizeBytes, postfix_operators=[], prefix_operators=[], qualifier=orcSerDe, selectors=[], type_arguments=None), MemberReference(member=STRIPESIZEBYTES_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=getBlockSizeBytes, postfix_operators=[], prefix_operators=[], qualifier=orcSerDe, selectors=[], type_arguments=None), MemberReference(member=BLOCKSIZEBYTES_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=getRowIndexStride, postfix_operators=[], prefix_operators=[], qualifier=orcSerDe, selectors=[], type_arguments=None), MemberReference(member=ROWINDEXSTRIDE_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=getEnablePadding, postfix_operators=[], prefix_operators=[], qualifier=orcSerDe, selectors=[], type_arguments=None), MemberReference(member=ENABLEPADDING_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=getPaddingTolerance, postfix_operators=[], prefix_operators=[], qualifier=orcSerDe, selectors=[], type_arguments=None), MemberReference(member=PADDINGTOLERANCE_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=getCompression, postfix_operators=[], prefix_operators=[], qualifier=orcSerDe, selectors=[], type_arguments=None), MemberReference(member=COMPRESSION_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=getBloomFilterColumns, postfix_operators=[], prefix_operators=[], qualifier=orcSerDe, selectors=[], type_arguments=None), MemberReference(member=BLOOMFILTERCOLUMNS_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=getBloomFilterFalsePositiveProbability, postfix_operators=[], prefix_operators=[], qualifier=orcSerDe, selectors=[], type_arguments=None), MemberReference(member=BLOOMFILTERFALSEPOSITIVEPROBABILITY_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=getDictionaryKeyThreshold, postfix_operators=[], prefix_operators=[], qualifier=orcSerDe, selectors=[], type_arguments=None), MemberReference(member=DICTIONARYKEYTHRESHOLD_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=getFormatVersion, postfix_operators=[], prefix_operators=[], qualifier=orcSerDe, selectors=[], type_arguments=None), MemberReference(member=FORMATVERSION_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[OrcSerDe] identifier[orcSerDe] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[orcSerDe] 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[orcSerDe] operator[SEP] identifier[getStripeSizeBytes] operator[SEP] operator[SEP] , identifier[STRIPESIZEBYTES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[orcSerDe] operator[SEP] identifier[getBlockSizeBytes] operator[SEP] operator[SEP] , identifier[BLOCKSIZEBYTES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[orcSerDe] operator[SEP] identifier[getRowIndexStride] operator[SEP] operator[SEP] , identifier[ROWINDEXSTRIDE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[orcSerDe] operator[SEP] identifier[getEnablePadding] operator[SEP] operator[SEP] , identifier[ENABLEPADDING_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[orcSerDe] operator[SEP] identifier[getPaddingTolerance] operator[SEP] operator[SEP] , identifier[PADDINGTOLERANCE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[orcSerDe] operator[SEP] identifier[getCompression] operator[SEP] operator[SEP] , identifier[COMPRESSION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[orcSerDe] operator[SEP] identifier[getBloomFilterColumns] operator[SEP] operator[SEP] , identifier[BLOOMFILTERCOLUMNS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[orcSerDe] operator[SEP] identifier[getBloomFilterFalsePositiveProbability] operator[SEP] operator[SEP] , identifier[BLOOMFILTERFALSEPOSITIVEPROBABILITY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[orcSerDe] operator[SEP] identifier[getDictionaryKeyThreshold] operator[SEP] operator[SEP] , identifier[DICTIONARYKEYTHRESHOLD_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[orcSerDe] operator[SEP] identifier[getFormatVersion] operator[SEP] operator[SEP] , identifier[FORMATVERSION_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]
}
}
|
static List<String> nameSegments(ObjectName objectName) {
List<String> segments = new ArrayList<>();
segments.add(objectName.getDomain());
for (String s : objectName.getKeyPropertyListString().split(",")) {
int index = s.indexOf('=');
if (index < 0) {
continue;
}
String key = objectName.getKeyProperty(s.substring(0, index));
if (s.substring(0, index).equals("type")) {
segments.add(1, key);
} else {
segments.add(key);
}
}
return segments;
}
|
class class_name[name] begin[{]
method[nameSegments, return_type[type[List]], modifier[static], parameter[objectName]] begin[{]
local_variable[type[List], segments]
call[segments.add, parameter[call[objectName.getDomain, parameter[]]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='=')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, 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=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=getKeyProperty, postfix_operators=[], prefix_operators=[], qualifier=objectName, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=segments, 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=1), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=segments, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getKeyPropertyListString, postfix_operators=[], prefix_operators=[], qualifier=objectName, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.segments]]
end[}]
END[}]
|
Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[nameSegments] operator[SEP] identifier[ObjectName] identifier[objectName] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[segments] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[segments] operator[SEP] identifier[add] operator[SEP] identifier[objectName] operator[SEP] identifier[getDomain] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[objectName] operator[SEP] identifier[getKeyPropertyListString] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[int] identifier[index] operator[=] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[<] Other[0] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[String] identifier[key] operator[=] identifier[objectName] operator[SEP] identifier[getKeyProperty] operator[SEP] identifier[s] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[segments] operator[SEP] identifier[add] operator[SEP] Other[1] , identifier[key] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[segments] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[segments] operator[SEP]
}
|
protected XExpression _generate(XThrowExpression throwStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
it.append("raise "); //$NON-NLS-1$
generate(throwStatement.getExpression(), it, context);
return throwStatement;
}
|
class class_name[name] begin[{]
method[_generate, return_type[type[XExpression]], modifier[protected], parameter[throwStatement, it, context]] begin[{]
call[it.append, parameter[literal["raise "]]]
call[.generate, parameter[call[throwStatement.getExpression, parameter[]], member[.it], member[.context]]]
return[member[.throwStatement]]
end[}]
END[}]
|
Keyword[protected] identifier[XExpression] identifier[_generate] operator[SEP] identifier[XThrowExpression] identifier[throwStatement] , identifier[IAppendable] identifier[it] , identifier[IExtraLanguageGeneratorContext] identifier[context] operator[SEP] {
identifier[it] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[generate] operator[SEP] identifier[throwStatement] operator[SEP] identifier[getExpression] operator[SEP] operator[SEP] , identifier[it] , identifier[context] operator[SEP] operator[SEP] Keyword[return] identifier[throwStatement] operator[SEP]
}
|
public static Map<String, ? extends CacheConfig> fromYAML(String content) throws IOException {
return new CacheConfigSupport().fromYAML(content);
}
|
class class_name[name] begin[{]
method[fromYAML, return_type[type[Map]], modifier[public static], parameter[content]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromYAML, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=CacheConfigSupport, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , operator[?] Keyword[extends] identifier[CacheConfig] operator[>] identifier[fromYAML] operator[SEP] identifier[String] identifier[content] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] Keyword[new] identifier[CacheConfigSupport] operator[SEP] operator[SEP] operator[SEP] identifier[fromYAML] operator[SEP] identifier[content] operator[SEP] operator[SEP]
}
|
private void percolateUp(int pos) {
int x = this.heap.get(pos);
int p = parent(pos);
int j = pos;
while (j != 0 && this.s.lt(x, this.heap.get(p))) {
this.heap.set(j, this.heap.get(p));
this.indices.set(this.heap.get(p), j);
j = p;
p = parent(p);
}
this.heap.set(j, x);
this.indices.set(x, j);
}
|
class class_name[name] begin[{]
method[percolateUp, return_type[void], modifier[private], parameter[pos]] begin[{]
local_variable[type[int], x]
local_variable[type[int], p]
local_variable[type[int], j]
while[binary_operation[binary_operation[member[.j], !=, literal[0]], &&, THIS[member[None.s]call[None.lt, parameter[member[.x], THIS[member[None.heap]call[None.get, parameter[member[.p]]]]]]]]] begin[{]
THIS[member[None.heap]call[None.set, parameter[member[.j], THIS[member[None.heap]call[None.get, parameter[member[.p]]]]]]]
THIS[member[None.indices]call[None.set, parameter[THIS[member[None.heap]call[None.get, parameter[member[.p]]]], member[.j]]]]
assign[member[.j], member[.p]]
assign[member[.p], call[.parent, parameter[member[.p]]]]
end[}]
THIS[member[None.heap]call[None.set, parameter[member[.j], member[.x]]]]
THIS[member[None.indices]call[None.set, parameter[member[.x], member[.j]]]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[percolateUp] operator[SEP] Keyword[int] identifier[pos] operator[SEP] {
Keyword[int] identifier[x] operator[=] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[pos] operator[SEP] operator[SEP] Keyword[int] identifier[p] operator[=] identifier[parent] operator[SEP] identifier[pos] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[pos] operator[SEP] Keyword[while] operator[SEP] identifier[j] operator[!=] Other[0] operator[&&] Keyword[this] operator[SEP] identifier[s] operator[SEP] identifier[lt] operator[SEP] identifier[x] , Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[p] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[set] operator[SEP] identifier[j] , Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[p] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[indices] operator[SEP] identifier[set] operator[SEP] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[p] operator[SEP] , identifier[j] operator[SEP] operator[SEP] identifier[j] operator[=] identifier[p] operator[SEP] identifier[p] operator[=] identifier[parent] operator[SEP] identifier[p] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[set] operator[SEP] identifier[j] , identifier[x] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[indices] operator[SEP] identifier[set] operator[SEP] identifier[x] , identifier[j] operator[SEP] operator[SEP]
}
|
public static Span exact(Bytes row) {
Objects.requireNonNull(row);
return new Span(row, true, row, true);
}
|
class class_name[name] begin[{]
method[exact, return_type[type[Span]], modifier[public static], parameter[row]] begin[{]
call[Objects.requireNonNull, parameter[member[.row]]]
return[ClassCreator(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Span, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Span] identifier[exact] operator[SEP] identifier[Bytes] identifier[row] operator[SEP] {
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[row] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Span] operator[SEP] identifier[row] , literal[boolean] , identifier[row] , literal[boolean] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.