code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public String convertColorSpecificationColSpceToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} | class class_name[name] begin[{]
method[convertColorSpecificationColSpceToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, 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=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}] | Keyword[public] identifier[String] identifier[convertColorSpecificationColSpceToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] {
Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public void registerDefaults() {
typeToRenderer.clear();
ServiceLoader<TableCellRenderer> serviceLoader = ServiceLoader.load(TableCellRenderer.class);
Iterator<TableCellRenderer> iterator = serviceLoader.iterator();
while (iterator.hasNext()) {
TableCellRenderer next = iterator.next();
try {
RendererRegistry annotation = next.getClass().getAnnotation(RendererRegistry.class);
if (annotation != null) {
for (Class<?> clazz : annotation.type()) {
registerRenderer(clazz, next);
}
}
Method m = next.getClass().getMethod("setShowOddAndEvenRows", boolean.class);
if (m != null) {
m.invoke(next, false);
}
} catch (NoSuchMethodException ex) {
} catch (SecurityException ex) {
} catch (IllegalAccessException ex) {
} catch (IllegalArgumentException ex) {
} catch (InvocationTargetException ex) {
}
}
} | class class_name[name] begin[{]
method[registerDefaults, return_type[void], modifier[public], parameter[]] begin[{]
call[typeToRenderer.clear, parameter[]]
local_variable[type[ServiceLoader], serviceLoader]
local_variable[type[Iterator], iterator]
while[call[iterator.hasNext, parameter[]]] begin[{]
local_variable[type[TableCellRenderer], next]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RendererRegistry, sub_type=None))], member=getAnnotation, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RendererRegistry, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerRenderer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="setShowOddAndEvenRows"), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=boolean))], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NoSuchMethodException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SecurityException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalAccessException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalArgumentException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['InvocationTargetException']))], finally_block=None, label=None, resources=None)
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[registerDefaults] operator[SEP] operator[SEP] {
identifier[typeToRenderer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[ServiceLoader] operator[<] identifier[TableCellRenderer] operator[>] identifier[serviceLoader] operator[=] identifier[ServiceLoader] operator[SEP] identifier[load] operator[SEP] identifier[TableCellRenderer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[TableCellRenderer] operator[>] identifier[iterator] operator[=] identifier[serviceLoader] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[TableCellRenderer] identifier[next] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[RendererRegistry] identifier[annotation] operator[=] identifier[next] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[RendererRegistry] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[annotation] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[:] identifier[annotation] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] {
identifier[registerRenderer] operator[SEP] identifier[clazz] , identifier[next] operator[SEP] operator[SEP]
}
}
identifier[Method] identifier[m] operator[=] identifier[next] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getMethod] operator[SEP] literal[String] , Keyword[boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[!=] Other[null] operator[SEP] {
identifier[m] operator[SEP] identifier[invoke] operator[SEP] identifier[next] , literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[ex] operator[SEP] {
}
Keyword[catch] operator[SEP] identifier[SecurityException] identifier[ex] operator[SEP] {
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[ex] operator[SEP] {
}
Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[ex] operator[SEP] {
}
Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[ex] operator[SEP] {
}
}
}
|
@Beta
public static HostnameVerifier trustAllHostnameVerifier() {
return new HostnameVerifier() {
public boolean verify(String arg0, SSLSession arg1) {
return true;
}
};
} | class class_name[name] begin[{]
method[trustAllHostnameVerifier, return_type[type[HostnameVerifier]], modifier[public static], parameter[]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], documentation=None, modifiers={'public'}, name=verify, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=arg1, type=ReferenceType(arguments=None, dimensions=[], name=SSLSession, 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=HostnameVerifier, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Beta] Keyword[public] Keyword[static] identifier[HostnameVerifier] identifier[trustAllHostnameVerifier] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[HostnameVerifier] operator[SEP] operator[SEP] {
Keyword[public] Keyword[boolean] identifier[verify] operator[SEP] identifier[String] identifier[arg0] , identifier[SSLSession] identifier[arg1] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
} operator[SEP]
}
|
public boolean shouldBeProcessed(final ProfileSettings profileSettings) {
if (profileSettings != null) {
String propertyName = GetterUtilities.getFullQualifiedFieldName(baseType, method);
Boolean shouldBeProcessed = profileSettings.getPropertyValue(propertyName);
if (shouldBeProcessed == null) {
propertyName = baseType.getCanonicalName() + "." + method.getName();
shouldBeProcessed = profileSettings.getPropertyValue(propertyName);
}
if (shouldBeProcessed == null && annotation != null) {
shouldBeProcessed = annotation.enabledPerDefault();
}
if (shouldBeProcessed != null) {
return shouldBeProcessed;
}
}
return true;
} | class class_name[name] begin[{]
method[shouldBeProcessed, return_type[type[boolean]], modifier[public], parameter[profileSettings]] begin[{]
if[binary_operation[member[.profileSettings], !=, literal[null]]] begin[{]
local_variable[type[String], propertyName]
local_variable[type[Boolean], shouldBeProcessed]
if[binary_operation[member[.shouldBeProcessed], ==, literal[null]]] begin[{]
assign[member[.propertyName], binary_operation[binary_operation[call[baseType.getCanonicalName, parameter[]], +, literal["."]], +, call[method.getName, parameter[]]]]
assign[member[.shouldBeProcessed], call[profileSettings.getPropertyValue, parameter[member[.propertyName]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.shouldBeProcessed], ==, literal[null]], &&, binary_operation[member[.annotation], !=, literal[null]]]] begin[{]
assign[member[.shouldBeProcessed], call[annotation.enabledPerDefault, parameter[]]]
else begin[{]
None
end[}]
if[binary_operation[member[.shouldBeProcessed], !=, literal[null]]] begin[{]
return[member[.shouldBeProcessed]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[shouldBeProcessed] operator[SEP] Keyword[final] identifier[ProfileSettings] identifier[profileSettings] operator[SEP] {
Keyword[if] operator[SEP] identifier[profileSettings] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[propertyName] operator[=] identifier[GetterUtilities] operator[SEP] identifier[getFullQualifiedFieldName] operator[SEP] identifier[baseType] , identifier[method] operator[SEP] operator[SEP] identifier[Boolean] identifier[shouldBeProcessed] operator[=] identifier[profileSettings] operator[SEP] identifier[getPropertyValue] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[shouldBeProcessed] operator[==] Other[null] operator[SEP] {
identifier[propertyName] operator[=] identifier[baseType] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[method] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[shouldBeProcessed] operator[=] identifier[profileSettings] operator[SEP] identifier[getPropertyValue] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[shouldBeProcessed] operator[==] Other[null] operator[&&] identifier[annotation] operator[!=] Other[null] operator[SEP] {
identifier[shouldBeProcessed] operator[=] identifier[annotation] operator[SEP] identifier[enabledPerDefault] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[shouldBeProcessed] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[shouldBeProcessed] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public synchronized void remove(Runnable runnable) {
Iterator<ScheduledRunnable> iterator = runnables.iterator();
while (iterator.hasNext()) {
if (iterator.next().runnable == runnable) {
iterator.remove();
}
}
} | class class_name[name] begin[{]
method[remove, return_type[void], modifier[synchronized public], parameter[runnable]] begin[{]
local_variable[type[Iterator], iterator]
while[call[iterator.hasNext, parameter[]]] begin[{]
if[binary_operation[call[iterator.next, parameter[]], ==, member[.runnable]]] begin[{]
call[iterator.remove, parameter[]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[remove] operator[SEP] identifier[Runnable] identifier[runnable] operator[SEP] {
identifier[Iterator] operator[<] identifier[ScheduledRunnable] operator[>] identifier[iterator] operator[=] identifier[runnables] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[runnable] operator[==] identifier[runnable] operator[SEP] {
identifier[iterator] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public static String getContentTypeAttribute(String input, String name) {
int begin;
int end;
int index = input.toUpperCase().indexOf(name.toUpperCase());
if (index == -1) {
return null;
}
index = index + name.length(); // positioned after the attribute name
index = input.indexOf('=', index); // positioned at the '='
if (index == -1) {
return null;
}
index += 1; // positioned after the '='
input = input.substring(index).trim();
if (input.charAt(0) == '"') {
// attribute value is a quoted string
begin = 1;
end = input.indexOf('"', begin);
if (end == -1) {
return null;
}
} else {
begin = 0;
end = input.indexOf(';');
if (end == -1) {
end = input.indexOf(' ');
}
if (end == -1) {
end = input.length();
}
}
return input.substring(begin, end).trim();
} | class class_name[name] begin[{]
method[getContentTypeAttribute, return_type[type[String]], modifier[public static], parameter[input, name]] begin[{]
local_variable[type[int], begin]
local_variable[type[int], end]
local_variable[type[int], index]
if[binary_operation[member[.index], ==, literal[1]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
assign[member[.index], binary_operation[member[.index], +, call[name.length, parameter[]]]]
assign[member[.index], call[input.indexOf, parameter[literal['='], member[.index]]]]
if[binary_operation[member[.index], ==, literal[1]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
assign[member[.index], literal[1]]
assign[member[.input], call[input.substring, parameter[member[.index]]]]
if[binary_operation[call[input.charAt, parameter[literal[0]]], ==, literal['"']]] begin[{]
assign[member[.begin], literal[1]]
assign[member[.end], call[input.indexOf, parameter[literal['"'], member[.begin]]]]
if[binary_operation[member[.end], ==, literal[1]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
else begin[{]
assign[member[.begin], literal[0]]
assign[member[.end], call[input.indexOf, parameter[literal[';']]]]
if[binary_operation[member[.end], ==, literal[1]]] begin[{]
assign[member[.end], call[input.indexOf, parameter[literal[' ']]]]
else begin[{]
None
end[}]
if[binary_operation[member[.end], ==, literal[1]]] begin[{]
assign[member[.end], call[input.length, parameter[]]]
else begin[{]
None
end[}]
end[}]
return[call[input.substring, parameter[member[.begin], member[.end]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getContentTypeAttribute] operator[SEP] identifier[String] identifier[input] , identifier[String] identifier[name] operator[SEP] {
Keyword[int] identifier[begin] operator[SEP] Keyword[int] identifier[end] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[input] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] identifier[indexOf] operator[SEP] identifier[name] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[index] operator[=] identifier[index] operator[+] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[=] identifier[input] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[index] operator[+=] Other[1] operator[SEP] identifier[input] operator[=] identifier[input] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[begin] operator[=] Other[1] operator[SEP] identifier[end] operator[=] identifier[input] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[begin] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[end] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
}
Keyword[else] {
identifier[begin] operator[=] Other[0] operator[SEP] identifier[end] operator[=] identifier[input] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[end] operator[==] operator[-] Other[1] operator[SEP] {
identifier[end] operator[=] identifier[input] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[end] operator[==] operator[-] Other[1] operator[SEP] {
identifier[end] operator[=] identifier[input] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[input] operator[SEP] identifier[substring] operator[SEP] identifier[begin] , identifier[end] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP]
}
|
public static final int pwr2LawPrev(final int ppo, final int curPoint) {
if (curPoint <= 1) { return 0; }
int gi = (int)round(log2(curPoint) * ppo); //current generating index
int prev;
do {
prev = (int)round(pow(2.0, (double) --gi / ppo));
} while (prev >= curPoint);
return prev;
} | class class_name[name] begin[{]
method[pwr2LawPrev, return_type[type[int]], modifier[final public static], parameter[ppo, curPoint]] begin[{]
if[binary_operation[member[.curPoint], <=, literal[1]]] begin[{]
return[literal[0]]
else begin[{]
None
end[}]
local_variable[type[int], gi]
local_variable[type[int], prev]
do[binary_operation[member[.prev], >=, member[.curPoint]]] begin[{]
assign[member[.prev], Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2.0), BinaryOperation(operandl=Cast(expression=MemberReference(member=gi, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), operandr=MemberReference(member=ppo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)], member=pow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=round, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]
end[}]
return[member[.prev]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] Keyword[int] identifier[pwr2LawPrev] operator[SEP] Keyword[final] Keyword[int] identifier[ppo] , Keyword[final] Keyword[int] identifier[curPoint] operator[SEP] {
Keyword[if] operator[SEP] identifier[curPoint] operator[<=] Other[1] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
Keyword[int] identifier[gi] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[round] operator[SEP] identifier[log2] operator[SEP] identifier[curPoint] operator[SEP] operator[*] identifier[ppo] operator[SEP] operator[SEP] Keyword[int] identifier[prev] operator[SEP] Keyword[do] {
identifier[prev] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[round] operator[SEP] identifier[pow] operator[SEP] literal[Float] , operator[SEP] Keyword[double] operator[SEP] operator[--] identifier[gi] operator[/] identifier[ppo] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] identifier[prev] operator[>=] identifier[curPoint] operator[SEP] operator[SEP] Keyword[return] identifier[prev] operator[SEP]
}
|
public static String decryptContent(String content, String encryptType, String encryptKey,
String charset) throws AlipayApiException {
if (AES_ALG.equals(encryptType)) {
return aesDecrypt(content, encryptKey, charset);
} else {
throw new AlipayApiException("当前不支持该算法类型:encrypeType=" + encryptType);
}
} | class class_name[name] begin[{]
method[decryptContent, return_type[type[String]], modifier[public static], parameter[content, encryptType, encryptKey, charset]] begin[{]
if[call[AES_ALG.equals, parameter[member[.encryptType]]]] begin[{]
return[call[.aesDecrypt, parameter[member[.content], member[.encryptKey], member[.charset]]]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="当前不支持该算法类型:encrypeType="), operandr=MemberReference(member=encryptType, 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=AlipayApiException, sub_type=None)), label=None)
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[decryptContent] operator[SEP] identifier[String] identifier[content] , identifier[String] identifier[encryptType] , identifier[String] identifier[encryptKey] , identifier[String] identifier[charset] operator[SEP] Keyword[throws] identifier[AlipayApiException] {
Keyword[if] operator[SEP] identifier[AES_ALG] operator[SEP] identifier[equals] operator[SEP] identifier[encryptType] operator[SEP] operator[SEP] {
Keyword[return] identifier[aesDecrypt] operator[SEP] identifier[content] , identifier[encryptKey] , identifier[charset] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[AlipayApiException] operator[SEP] literal[String] operator[+] identifier[encryptType] operator[SEP] operator[SEP]
}
}
|
public User getByEmail( Connection conn, String email) throws SQLException {
ResultSetHandler<User> h = new BeanHandler<User>(User.class);
String sql =
"SELECT id,username,fullname,type,emailaddress,registered_ts,invited_by,enabled \n"+
"FROM userbase \n"+
"WHERE emailaddress=?";
return run.query(conn, sql, h, email);
} | class class_name[name] begin[{]
method[getByEmail, return_type[type[User]], modifier[public], parameter[conn, email]] begin[{]
local_variable[type[ResultSetHandler], h]
local_variable[type[String], sql]
return[call[run.query, parameter[member[.conn], member[.sql], member[.h], member[.email]]]]
end[}]
END[}] | Keyword[public] identifier[User] identifier[getByEmail] operator[SEP] identifier[Connection] identifier[conn] , identifier[String] identifier[email] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[ResultSetHandler] operator[<] identifier[User] operator[>] identifier[h] operator[=] Keyword[new] identifier[BeanHandler] operator[<] identifier[User] operator[>] operator[SEP] identifier[User] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[String] identifier[sql] operator[=] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] Keyword[return] identifier[run] operator[SEP] identifier[query] operator[SEP] identifier[conn] , identifier[sql] , identifier[h] , identifier[email] operator[SEP] operator[SEP]
}
|
private synchronized void resetCurrentSegment() {
JournalSegment<E> lastSegment = getLastSegment();
if (lastSegment != null) {
currentSegment = lastSegment;
} else {
JournalSegmentDescriptor descriptor = JournalSegmentDescriptor.builder()
.withId(1)
.withIndex(1)
.withMaxSegmentSize(maxSegmentSize)
.withMaxEntries(maxEntriesPerSegment)
.build();
currentSegment = createSegment(descriptor);
segments.put(1L, currentSegment);
}
} | class class_name[name] begin[{]
method[resetCurrentSegment, return_type[void], modifier[synchronized private], parameter[]] begin[{]
local_variable[type[JournalSegment], lastSegment]
if[binary_operation[member[.lastSegment], !=, literal[null]]] begin[{]
assign[member[.currentSegment], member[.lastSegment]]
else begin[{]
local_variable[type[JournalSegmentDescriptor], descriptor]
assign[member[.currentSegment], call[.createSegment, parameter[member[.descriptor]]]]
call[segments.put, parameter[literal[1L], member[.currentSegment]]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[synchronized] Keyword[void] identifier[resetCurrentSegment] operator[SEP] operator[SEP] {
identifier[JournalSegment] operator[<] identifier[E] operator[>] identifier[lastSegment] operator[=] identifier[getLastSegment] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastSegment] operator[!=] Other[null] operator[SEP] {
identifier[currentSegment] operator[=] identifier[lastSegment] operator[SEP]
}
Keyword[else] {
identifier[JournalSegmentDescriptor] identifier[descriptor] operator[=] identifier[JournalSegmentDescriptor] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[withId] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[withIndex] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[withMaxSegmentSize] operator[SEP] identifier[maxSegmentSize] operator[SEP] operator[SEP] identifier[withMaxEntries] operator[SEP] identifier[maxEntriesPerSegment] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[currentSegment] operator[=] identifier[createSegment] operator[SEP] identifier[descriptor] operator[SEP] operator[SEP] identifier[segments] operator[SEP] identifier[put] operator[SEP] Other[1L] , identifier[currentSegment] operator[SEP] operator[SEP]
}
}
|
protected void cyclicDependencyCheck(List<PDefinition> defs)
{
if (System.getProperty("skip.cyclic.check") != null)
{
return; // For now, to allow us to skip if there are issues.
}
if (getErrorCount() > 0)
{
return; // Can't really check everything until it's clean
}
Map<ILexNameToken, LexNameSet> dependencies = new HashMap<ILexNameToken, LexNameSet>();
LexNameSet skip = new LexNameSet();
PDefinitionAssistantTC assistant = assistantFactory.createPDefinitionAssistant();
Environment globals = new FlatEnvironment(assistantFactory, defs, null);
for (PDefinition def: defs)
{
Environment env = new FlatEnvironment(assistantFactory, new Vector<PDefinition>());
FreeVarInfo empty = new FreeVarInfo(globals, env, false);
LexNameSet freevars = assistant.getFreeVariables(def, empty);
if (!freevars.isEmpty())
{
for (ILexNameToken name: assistant.getVariableNames(def))
{
dependencies.put(nameFix(name.getExplicit(true)), nameFix(freevars));
}
}
// Skipped definition names occur in the cycle path, but are not checked
// for cycles themselves, because they are not "initializable".
if (assistant.isTypeDefinition(def) || assistant.isOperation(def))
{
if (def.getName() != null)
{
skip.add(nameFix(def.getName().getExplicit(true)));
}
}
}
for (ILexNameToken sought: dependencies.keySet())
{
if (!skip.contains(sought))
{
Stack<ILexNameToken> stack = new Stack<ILexNameToken>();
stack.push(sought);
if (reachable(sought, dependencies.get(sought), dependencies, stack))
{
report(3355, "Cyclic dependency detected for " + sought, sought.getLocation());
detail("Cycle", stack.toString());
}
stack.pop();
}
}
} | class class_name[name] begin[{]
method[cyclicDependencyCheck, return_type[void], modifier[protected], parameter[defs]] begin[{]
if[binary_operation[call[System.getProperty, parameter[literal["skip.cyclic.check"]]], !=, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[binary_operation[call[.getErrorCount, parameter[]], >, literal[0]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[Map], dependencies]
local_variable[type[LexNameSet], skip]
local_variable[type[PDefinitionAssistantTC], assistant]
local_variable[type[Environment], globals]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=assistantFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=PDefinition, sub_type=None))], dimensions=None, name=Vector, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FlatEnvironment, sub_type=None)), name=env)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Environment, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=globals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=env, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FreeVarInfo, sub_type=None)), name=empty)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FreeVarInfo, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=empty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFreeVariables, postfix_operators=[], prefix_operators=[], qualifier=assistant, selectors=[], type_arguments=None), name=freevars)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LexNameSet, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=freevars, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getExplicit, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None)], member=nameFix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=freevars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nameFix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=dependencies, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getVariableNames, postfix_operators=[], prefix_operators=[], qualifier=assistant, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ILexNameToken, sub_type=None))), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isTypeDefinition, postfix_operators=[], prefix_operators=[], qualifier=assistant, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isOperation, postfix_operators=[], prefix_operators=[], qualifier=assistant, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=def, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=def, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getExplicit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=nameFix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=skip, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=defs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=def)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PDefinition, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sought, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=skip, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ILexNameToken, sub_type=None))], dimensions=None, name=Stack, sub_type=None)), name=stack)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ILexNameToken, sub_type=None))], dimensions=[], name=Stack, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sought, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sought, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=sought, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=dependencies, selectors=[], type_arguments=None), MemberReference(member=dependencies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reachable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3355), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cyclic dependency detected for "), operandr=MemberReference(member=sought, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MethodInvocation(arguments=[], member=getLocation, postfix_operators=[], prefix_operators=[], qualifier=sought, selectors=[], type_arguments=None)], member=report, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cycle"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None)], member=detail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=dependencies, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sought)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ILexNameToken, sub_type=None))), label=None)
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[cyclicDependencyCheck] operator[SEP] identifier[List] operator[<] identifier[PDefinition] operator[>] identifier[defs] operator[SEP] {
Keyword[if] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[getErrorCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[Map] operator[<] identifier[ILexNameToken] , identifier[LexNameSet] operator[>] identifier[dependencies] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[ILexNameToken] , identifier[LexNameSet] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[LexNameSet] identifier[skip] operator[=] Keyword[new] identifier[LexNameSet] operator[SEP] operator[SEP] operator[SEP] identifier[PDefinitionAssistantTC] identifier[assistant] operator[=] identifier[assistantFactory] operator[SEP] identifier[createPDefinitionAssistant] operator[SEP] operator[SEP] operator[SEP] identifier[Environment] identifier[globals] operator[=] Keyword[new] identifier[FlatEnvironment] operator[SEP] identifier[assistantFactory] , identifier[defs] , Other[null] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PDefinition] identifier[def] operator[:] identifier[defs] operator[SEP] {
identifier[Environment] identifier[env] operator[=] Keyword[new] identifier[FlatEnvironment] operator[SEP] identifier[assistantFactory] , Keyword[new] identifier[Vector] operator[<] identifier[PDefinition] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[FreeVarInfo] identifier[empty] operator[=] Keyword[new] identifier[FreeVarInfo] operator[SEP] identifier[globals] , identifier[env] , literal[boolean] operator[SEP] operator[SEP] identifier[LexNameSet] identifier[freevars] operator[=] identifier[assistant] operator[SEP] identifier[getFreeVariables] operator[SEP] identifier[def] , identifier[empty] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[freevars] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[ILexNameToken] identifier[name] operator[:] identifier[assistant] operator[SEP] identifier[getVariableNames] operator[SEP] identifier[def] operator[SEP] operator[SEP] {
identifier[dependencies] operator[SEP] identifier[put] operator[SEP] identifier[nameFix] operator[SEP] identifier[name] operator[SEP] identifier[getExplicit] operator[SEP] literal[boolean] operator[SEP] operator[SEP] , identifier[nameFix] operator[SEP] identifier[freevars] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[assistant] operator[SEP] identifier[isTypeDefinition] operator[SEP] identifier[def] operator[SEP] operator[||] identifier[assistant] operator[SEP] identifier[isOperation] operator[SEP] identifier[def] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[skip] operator[SEP] identifier[add] operator[SEP] identifier[nameFix] operator[SEP] identifier[def] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[getExplicit] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[for] operator[SEP] identifier[ILexNameToken] identifier[sought] operator[:] identifier[dependencies] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[skip] operator[SEP] identifier[contains] operator[SEP] identifier[sought] operator[SEP] operator[SEP] {
identifier[Stack] operator[<] identifier[ILexNameToken] operator[>] identifier[stack] operator[=] Keyword[new] identifier[Stack] operator[<] identifier[ILexNameToken] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[sought] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reachable] operator[SEP] identifier[sought] , identifier[dependencies] operator[SEP] identifier[get] operator[SEP] identifier[sought] operator[SEP] , identifier[dependencies] , identifier[stack] operator[SEP] operator[SEP] {
identifier[report] operator[SEP] Other[3355] , literal[String] operator[+] identifier[sought] , identifier[sought] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[detail] operator[SEP] literal[String] , identifier[stack] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public CommandLineBuilder append(final String segment) {
if (segment != null && !segment.isEmpty()) {
return append(new String[]{segment});
}
return this;
} | class class_name[name] begin[{]
method[append, return_type[type[CommandLineBuilder]], modifier[public], parameter[segment]] begin[{]
if[binary_operation[binary_operation[member[.segment], !=, literal[null]], &&, call[segment.isEmpty, parameter[]]]] begin[{]
return[call[.append, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[CommandLineBuilder] identifier[append] operator[SEP] Keyword[final] identifier[String] identifier[segment] operator[SEP] {
Keyword[if] operator[SEP] identifier[segment] operator[!=] Other[null] operator[&&] operator[!] identifier[segment] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[append] operator[SEP] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[segment]
} operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
private CompletableFuture<LogicalSlot> allocateSingleSlot(
SlotRequestId slotRequestId,
SlotProfile slotProfile,
boolean allowQueuedScheduling,
Time allocationTimeout) {
Optional<SlotAndLocality> slotAndLocality = tryAllocateFromAvailable(slotRequestId, slotProfile);
if (slotAndLocality.isPresent()) {
// already successful from available
try {
return CompletableFuture.completedFuture(
completeAllocationByAssigningPayload(slotRequestId, slotAndLocality.get()));
} catch (FlinkException e) {
return FutureUtils.completedExceptionally(e);
}
} else if (allowQueuedScheduling) {
// we allocate by requesting a new slot
return slotPool
.requestNewAllocatedSlot(slotRequestId, slotProfile.getResourceProfile(), allocationTimeout)
.thenApply((PhysicalSlot allocatedSlot) -> {
try {
return completeAllocationByAssigningPayload(slotRequestId, new SlotAndLocality(allocatedSlot, Locality.UNKNOWN));
} catch (FlinkException e) {
throw new CompletionException(e);
}
});
} else {
// failed to allocate
return FutureUtils.completedExceptionally(
new NoResourceAvailableException("Could not allocate a simple slot for " + slotRequestId + '.'));
}
} | class class_name[name] begin[{]
method[allocateSingleSlot, return_type[type[CompletableFuture]], modifier[private], parameter[slotRequestId, slotProfile, allowQueuedScheduling, allocationTimeout]] begin[{]
local_variable[type[Optional], slotAndLocality]
if[call[slotAndLocality.isPresent, parameter[]]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=slotRequestId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=slotAndLocality, selectors=[], type_arguments=None)], member=completeAllocationByAssigningPayload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=completedFuture, postfix_operators=[], prefix_operators=[], qualifier=CompletableFuture, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=completedExceptionally, postfix_operators=[], prefix_operators=[], qualifier=FutureUtils, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FlinkException']))], finally_block=None, label=None, resources=None)
else begin[{]
if[member[.allowQueuedScheduling]] begin[{]
return[call[slotPool.requestNewAllocatedSlot, parameter[member[.slotRequestId], call[slotProfile.getResourceProfile, parameter[]], member[.allocationTimeout]]]]
else begin[{]
return[call[FutureUtils.completedExceptionally, parameter[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not allocate a simple slot for "), operandr=MemberReference(member=slotRequestId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoResourceAvailableException, sub_type=None))]]]
end[}]
end[}]
end[}]
END[}] | Keyword[private] identifier[CompletableFuture] operator[<] identifier[LogicalSlot] operator[>] identifier[allocateSingleSlot] operator[SEP] identifier[SlotRequestId] identifier[slotRequestId] , identifier[SlotProfile] identifier[slotProfile] , Keyword[boolean] identifier[allowQueuedScheduling] , identifier[Time] identifier[allocationTimeout] operator[SEP] {
identifier[Optional] operator[<] identifier[SlotAndLocality] operator[>] identifier[slotAndLocality] operator[=] identifier[tryAllocateFromAvailable] operator[SEP] identifier[slotRequestId] , identifier[slotProfile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[slotAndLocality] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[CompletableFuture] operator[SEP] identifier[completedFuture] operator[SEP] identifier[completeAllocationByAssigningPayload] operator[SEP] identifier[slotRequestId] , identifier[slotAndLocality] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[FlinkException] identifier[e] operator[SEP] {
Keyword[return] identifier[FutureUtils] operator[SEP] identifier[completedExceptionally] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[allowQueuedScheduling] operator[SEP] {
Keyword[return] identifier[slotPool] operator[SEP] identifier[requestNewAllocatedSlot] operator[SEP] identifier[slotRequestId] , identifier[slotProfile] operator[SEP] identifier[getResourceProfile] operator[SEP] operator[SEP] , identifier[allocationTimeout] operator[SEP] operator[SEP] identifier[thenApply] operator[SEP] operator[SEP] identifier[PhysicalSlot] identifier[allocatedSlot] operator[SEP] operator[->] {
Keyword[try] {
Keyword[return] identifier[completeAllocationByAssigningPayload] operator[SEP] identifier[slotRequestId] , Keyword[new] identifier[SlotAndLocality] operator[SEP] identifier[allocatedSlot] , identifier[Locality] operator[SEP] identifier[UNKNOWN] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[FlinkException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CompletionException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[FutureUtils] operator[SEP] identifier[completedExceptionally] operator[SEP] Keyword[new] identifier[NoResourceAvailableException] operator[SEP] literal[String] operator[+] identifier[slotRequestId] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static MethodHandle ofGetter(FieldDescription.InDefinedShape fieldDescription) {
return new MethodHandle(HandleType.ofGetter(fieldDescription),
fieldDescription.getDeclaringType().asErasure(),
fieldDescription.getInternalName(),
fieldDescription.getType().asErasure(),
Collections.<TypeDescription>emptyList());
} | class class_name[name] begin[{]
method[ofGetter, return_type[type[MethodHandle]], modifier[public static], parameter[fieldDescription]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=fieldDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ofGetter, postfix_operators=[], prefix_operators=[], qualifier=HandleType, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getDeclaringType, postfix_operators=[], prefix_operators=[], qualifier=fieldDescription, selectors=[MethodInvocation(arguments=[], member=asErasure, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getInternalName, postfix_operators=[], prefix_operators=[], qualifier=fieldDescription, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=fieldDescription, selectors=[MethodInvocation(arguments=[], member=asErasure, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=Collections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TypeDescription, sub_type=None))])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MethodHandle, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[MethodHandle] identifier[ofGetter] operator[SEP] identifier[FieldDescription] operator[SEP] identifier[InDefinedShape] identifier[fieldDescription] operator[SEP] {
Keyword[return] Keyword[new] identifier[MethodHandle] operator[SEP] identifier[HandleType] operator[SEP] identifier[ofGetter] operator[SEP] identifier[fieldDescription] operator[SEP] , identifier[fieldDescription] operator[SEP] identifier[getDeclaringType] operator[SEP] operator[SEP] operator[SEP] identifier[asErasure] operator[SEP] operator[SEP] , identifier[fieldDescription] operator[SEP] identifier[getInternalName] operator[SEP] operator[SEP] , identifier[fieldDescription] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[asErasure] operator[SEP] operator[SEP] , identifier[Collections] operator[SEP] operator[<] identifier[TypeDescription] operator[>] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Instant parseInstant(String value) {
TemporalAccessor temporalAccessor =
DateTimeFormatter.ofPattern(LOOSE_PARSER_FORMAT)
.parseBest(value, ZonedDateTime::from, LocalDateTime::from, LocalDate::from);
if (temporalAccessor instanceof ZonedDateTime) {
return ((ZonedDateTime) temporalAccessor).toInstant();
}
if (temporalAccessor instanceof LocalDateTime) {
return ((LocalDateTime) temporalAccessor).atZone(ZoneId.systemDefault()).toInstant();
}
return ((LocalDate) temporalAccessor).atStartOfDay(ZoneId.systemDefault()).toInstant();
} | class class_name[name] begin[{]
method[parseInstant, return_type[type[Instant]], modifier[public static], parameter[value]] begin[{]
local_variable[type[TemporalAccessor], temporalAccessor]
if[binary_operation[member[.temporalAccessor], instanceof, type[ZonedDateTime]]] begin[{]
return[Cast(expression=MemberReference(member=temporalAccessor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ZonedDateTime, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.temporalAccessor], instanceof, type[LocalDateTime]]] begin[{]
return[Cast(expression=MemberReference(member=temporalAccessor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LocalDateTime, sub_type=None))]
else begin[{]
None
end[}]
return[Cast(expression=MemberReference(member=temporalAccessor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LocalDate, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Instant] identifier[parseInstant] operator[SEP] identifier[String] identifier[value] operator[SEP] {
identifier[TemporalAccessor] identifier[temporalAccessor] operator[=] identifier[DateTimeFormatter] operator[SEP] identifier[ofPattern] operator[SEP] identifier[LOOSE_PARSER_FORMAT] operator[SEP] operator[SEP] identifier[parseBest] operator[SEP] identifier[value] , identifier[ZonedDateTime] operator[::] identifier[from] , identifier[LocalDateTime] operator[::] identifier[from] , identifier[LocalDate] operator[::] identifier[from] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[temporalAccessor] Keyword[instanceof] identifier[ZonedDateTime] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[ZonedDateTime] operator[SEP] identifier[temporalAccessor] operator[SEP] operator[SEP] identifier[toInstant] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[temporalAccessor] Keyword[instanceof] identifier[LocalDateTime] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[LocalDateTime] operator[SEP] identifier[temporalAccessor] operator[SEP] operator[SEP] identifier[atZone] operator[SEP] identifier[ZoneId] operator[SEP] identifier[systemDefault] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toInstant] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] operator[SEP] identifier[LocalDate] operator[SEP] identifier[temporalAccessor] operator[SEP] operator[SEP] identifier[atStartOfDay] operator[SEP] identifier[ZoneId] operator[SEP] identifier[systemDefault] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toInstant] operator[SEP] operator[SEP] operator[SEP]
}
|
public void clear(String cacheKey) {
ValueCacheKey key = getRequestCacheKey(cacheKey);
if (key != null) {
ConcurrentHashMap<ValueCacheKey, HystrixCachedObservable<?>> cacheInstance = requestVariableForCache.get(concurrencyStrategy);
if (cacheInstance == null) {
throw new IllegalStateException("Request caching is not available. Maybe you need to initialize the HystrixRequestContext?");
}
/* remove this cache key */
cacheInstance.remove(key);
}
} | class class_name[name] begin[{]
method[clear, return_type[void], modifier[public], parameter[cacheKey]] begin[{]
local_variable[type[ValueCacheKey], key]
if[binary_operation[member[.key], !=, literal[null]]] begin[{]
local_variable[type[ConcurrentHashMap], cacheInstance]
if[binary_operation[member[.cacheInstance], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request caching is not available. Maybe you need to initialize the HystrixRequestContext?")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[cacheInstance.remove, parameter[member[.key]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[clear] operator[SEP] identifier[String] identifier[cacheKey] operator[SEP] {
identifier[ValueCacheKey] identifier[key] operator[=] identifier[getRequestCacheKey] operator[SEP] identifier[cacheKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[!=] Other[null] operator[SEP] {
identifier[ConcurrentHashMap] operator[<] identifier[ValueCacheKey] , identifier[HystrixCachedObservable] operator[<] operator[?] operator[>] operator[>] identifier[cacheInstance] operator[=] identifier[requestVariableForCache] operator[SEP] identifier[get] operator[SEP] identifier[concurrencyStrategy] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cacheInstance] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[cacheInstance] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
}
|
protected <T, C> void processSelectGroup(String name, C criteria, T result, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, Connection con, boolean useRetrieve, CpoResultSet<T> resultSet) throws CpoException {
Logger localLogger = criteria == null ? logger : LoggerFactory.getLogger(criteria.getClass());
PreparedStatement ps = null;
List<CpoFunction> cpoFunctions;
CpoClass criteriaClass;
CpoClass resultClass;
ResultSet rs = null;
ResultSetMetaData rsmd;
int columnCount;
int k;
T obj;
JdbcCpoAttribute[] attributes;
JdbcPreparedStatementFactory jpsf;
int i;
if (criteria == null || result == null) {
throw new CpoException("NULL Object passed into retrieveBean or retrieveBeans");
}
try {
criteriaClass = metaDescriptor.getMetaClass(criteria);
resultClass = metaDescriptor.getMetaClass(result);
if (useRetrieve) {
localLogger.info("=================== Class=<" + criteria.getClass() + "> Type=<" + JdbcCpoAdapter.RETRIEVE_GROUP + "> Name=<" + name + "> =========================");
cpoFunctions = criteriaClass.getFunctionGroup(JdbcCpoAdapter.RETRIEVE_GROUP, name).getFunctions();
} else {
localLogger.info("=================== Class=<" + criteria.getClass() + "> Type=<" + JdbcCpoAdapter.LIST_GROUP + "> Name=<" + name + "> =========================");
cpoFunctions = criteriaClass.getFunctionGroup(JdbcCpoAdapter.LIST_GROUP, name).getFunctions();
}
for (CpoFunction cpoFunction : cpoFunctions) {
jpsf = new JdbcPreparedStatementFactory(con, this, criteriaClass, cpoFunction, criteria, wheres, orderBy, nativeExpressions);
ps = jpsf.getPreparedStatement();
if (resultSet.getFetchSize() != -1) {
ps.setFetchSize(resultSet.getFetchSize());
}
localLogger.debug("Retrieving Records");
rs = ps.executeQuery();
jpsf.release();
localLogger.debug("Processing Records");
rsmd = rs.getMetaData();
columnCount = rsmd.getColumnCount();
attributes = new JdbcCpoAttribute[columnCount + 1];
for (k = 1; k <= columnCount; k++) {
attributes[k] = (JdbcCpoAttribute) resultClass.getAttributeData(rsmd.getColumnLabel(k));
}
while (rs.next()) {
try {
obj = (T) result.getClass().newInstance();
} catch (IllegalAccessException iae) {
localLogger.error("=================== Could not access default constructor for Class=<" + result.getClass() + "> ==================");
throw new CpoException("Unable to access the constructor of the Return Object", iae);
} catch (InstantiationException iae) {
throw new CpoException("Unable to instantiate Return Object", iae);
}
for (k = 1; k <= columnCount; k++) {
if (attributes[k] != null) {
attributes[k].invokeSetter(obj, new ResultSetCpoData(JdbcMethodMapper.getMethodMapper(), rs, attributes[k], k));
}
}
try {
resultSet.put(obj);
} catch (InterruptedException e) {
localLogger.error("Retriever Thread was interrupted", e);
break;
}
}
resultSetClose(rs);
statementClose(ps);
localLogger.info("=================== " + resultSet.size() + " Records - Class=<" + criteria.getClass() + "> Type=<" + JdbcCpoAdapter.LIST_GROUP + "> Name=<" + name + "> Result=<" + result.getClass() + "> ====================");
}
} catch (Throwable t) {
String msg = "ProcessSelectGroup(String name, Object criteria, Object result, CpoWhere where, Collection orderBy, Connection con) failed. Error:";
localLogger.error(msg, t);
throw new CpoException(msg, t);
} finally {
resultSetClose(rs);
statementClose(ps);
}
} | class class_name[name] begin[{]
method[processSelectGroup, return_type[void], modifier[protected], parameter[name, criteria, result, wheres, orderBy, nativeExpressions, con, useRetrieve, resultSet]] begin[{]
local_variable[type[Logger], localLogger]
local_variable[type[PreparedStatement], ps]
local_variable[type[List], cpoFunctions]
local_variable[type[CpoClass], criteriaClass]
local_variable[type[CpoClass], resultClass]
local_variable[type[ResultSet], rs]
local_variable[type[ResultSetMetaData], rsmd]
local_variable[type[int], columnCount]
local_variable[type[int], k]
local_variable[type[T], obj]
local_variable[type[JdbcCpoAttribute], attributes]
local_variable[type[JdbcPreparedStatementFactory], jpsf]
local_variable[type[int], i]
if[binary_operation[binary_operation[member[.criteria], ==, literal[null]], ||, binary_operation[member[.result], ==, literal[null]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NULL Object passed into retrieveBean or retrieveBeans")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CpoException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=criteriaClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=criteria, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMetaClass, postfix_operators=[], prefix_operators=[], qualifier=metaDescriptor, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=resultClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMetaClass, postfix_operators=[], prefix_operators=[], qualifier=metaDescriptor, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=useRetrieve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=================== Class=<"), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> Type=<"), operator=+), operandr=MemberReference(member=LIST_GROUP, postfix_operators=[], prefix_operators=[], qualifier=JdbcCpoAdapter, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> Name=<"), operator=+), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> ========================="), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=localLogger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cpoFunctions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=LIST_GROUP, postfix_operators=[], prefix_operators=[], qualifier=JdbcCpoAdapter, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFunctionGroup, postfix_operators=[], prefix_operators=[], qualifier=criteriaClass, selectors=[MethodInvocation(arguments=[], member=getFunctions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=================== Class=<"), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> Type=<"), operator=+), operandr=MemberReference(member=RETRIEVE_GROUP, postfix_operators=[], prefix_operators=[], qualifier=JdbcCpoAdapter, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> Name=<"), operator=+), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> ========================="), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=localLogger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cpoFunctions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=RETRIEVE_GROUP, postfix_operators=[], prefix_operators=[], qualifier=JdbcCpoAdapter, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFunctionGroup, postfix_operators=[], prefix_operators=[], qualifier=criteriaClass, selectors=[MethodInvocation(arguments=[], member=getFunctions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=jpsf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=con, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=criteriaClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cpoFunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=criteria, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wheres, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orderBy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nativeExpressions, 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=JdbcPreparedStatementFactory, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getPreparedStatement, postfix_operators=[], prefix_operators=[], qualifier=jpsf, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFetchSize, postfix_operators=[], prefix_operators=[], qualifier=resultSet, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFetchSize, postfix_operators=[], prefix_operators=[], qualifier=resultSet, selectors=[], type_arguments=None)], member=setFetchSize, postfix_operators=[], prefix_operators=[], qualifier=ps, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Retrieving Records")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=localLogger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=ps, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=release, postfix_operators=[], prefix_operators=[], qualifier=jpsf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Processing Records")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=localLogger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rsmd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getMetaData, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=columnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getColumnCount, postfix_operators=[], prefix_operators=[], qualifier=rsmd, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[BinaryOperation(operandl=MemberReference(member=columnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JdbcCpoAttribute, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumnLabel, postfix_operators=[], prefix_operators=[], qualifier=rsmd, selectors=[], type_arguments=None)], member=getAttributeData, postfix_operators=[], prefix_operators=[], qualifier=resultClass, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JdbcCpoAttribute, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=columnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=[Assignment(expressionl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))], update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), WhileStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=================== Could not access default constructor for Class=<"), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> =================="), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=localLogger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to access the constructor of the Return Object"), MemberReference(member=iae, 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=CpoException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=iae, types=['IllegalAccessException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to instantiate Return Object"), MemberReference(member=iae, 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=CpoException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=iae, types=['InstantiationException']))], finally_block=None, label=None, resources=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, 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=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMethodMapper, postfix_operators=[], prefix_operators=[], qualifier=JdbcMethodMapper, selectors=[], type_arguments=None), MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=k, 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=ResultSetCpoData, sub_type=None))], member=invokeSetter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=columnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=[Assignment(expressionl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))], update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=resultSet, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Retriever Thread was interrupted"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=localLogger, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None)]), condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resultSetClose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=statementClose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=================== "), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=resultSet, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Records - Class=<"), operator=+), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> Type=<"), operator=+), operandr=MemberReference(member=LIST_GROUP, postfix_operators=[], prefix_operators=[], qualifier=JdbcCpoAdapter, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> Name=<"), operator=+), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> Result=<"), operator=+), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> ===================="), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=localLogger, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=cpoFunctions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cpoFunction)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CpoFunction, sub_type=None))), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ProcessSelectGroup(String name, Object criteria, Object result, CpoWhere where, Collection orderBy, Connection con) failed. Error:"), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=localLogger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=t, 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=CpoException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resultSetClose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=statementClose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[protected] operator[<] identifier[T] , identifier[C] operator[>] Keyword[void] identifier[processSelectGroup] operator[SEP] identifier[String] identifier[name] , identifier[C] identifier[criteria] , identifier[T] identifier[result] , identifier[Collection] operator[<] identifier[CpoWhere] operator[>] identifier[wheres] , identifier[Collection] operator[<] identifier[CpoOrderBy] operator[>] identifier[orderBy] , identifier[Collection] operator[<] identifier[CpoNativeFunction] operator[>] identifier[nativeExpressions] , identifier[Connection] identifier[con] , Keyword[boolean] identifier[useRetrieve] , identifier[CpoResultSet] operator[<] identifier[T] operator[>] identifier[resultSet] operator[SEP] Keyword[throws] identifier[CpoException] {
identifier[Logger] identifier[localLogger] operator[=] identifier[criteria] operator[==] Other[null] operator[?] identifier[logger] operator[:] identifier[LoggerFactory] operator[SEP] identifier[getLogger] operator[SEP] identifier[criteria] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[PreparedStatement] identifier[ps] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[CpoFunction] operator[>] identifier[cpoFunctions] operator[SEP] identifier[CpoClass] identifier[criteriaClass] operator[SEP] identifier[CpoClass] identifier[resultClass] operator[SEP] identifier[ResultSet] identifier[rs] operator[=] Other[null] operator[SEP] identifier[ResultSetMetaData] identifier[rsmd] operator[SEP] Keyword[int] identifier[columnCount] operator[SEP] Keyword[int] identifier[k] operator[SEP] identifier[T] identifier[obj] operator[SEP] identifier[JdbcCpoAttribute] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[JdbcPreparedStatementFactory] identifier[jpsf] operator[SEP] Keyword[int] identifier[i] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[==] Other[null] operator[||] identifier[result] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CpoException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[criteriaClass] operator[=] identifier[metaDescriptor] operator[SEP] identifier[getMetaClass] operator[SEP] identifier[criteria] operator[SEP] operator[SEP] identifier[resultClass] operator[=] identifier[metaDescriptor] operator[SEP] identifier[getMetaClass] operator[SEP] identifier[result] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[useRetrieve] operator[SEP] {
identifier[localLogger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[criteria] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[JdbcCpoAdapter] operator[SEP] identifier[RETRIEVE_GROUP] operator[+] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] identifier[cpoFunctions] operator[=] identifier[criteriaClass] operator[SEP] identifier[getFunctionGroup] operator[SEP] identifier[JdbcCpoAdapter] operator[SEP] identifier[RETRIEVE_GROUP] , identifier[name] operator[SEP] operator[SEP] identifier[getFunctions] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[localLogger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[criteria] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[JdbcCpoAdapter] operator[SEP] identifier[LIST_GROUP] operator[+] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] identifier[cpoFunctions] operator[=] identifier[criteriaClass] operator[SEP] identifier[getFunctionGroup] operator[SEP] identifier[JdbcCpoAdapter] operator[SEP] identifier[LIST_GROUP] , identifier[name] operator[SEP] operator[SEP] identifier[getFunctions] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[CpoFunction] identifier[cpoFunction] operator[:] identifier[cpoFunctions] operator[SEP] {
identifier[jpsf] operator[=] Keyword[new] identifier[JdbcPreparedStatementFactory] operator[SEP] identifier[con] , Keyword[this] , identifier[criteriaClass] , identifier[cpoFunction] , identifier[criteria] , identifier[wheres] , identifier[orderBy] , identifier[nativeExpressions] operator[SEP] operator[SEP] identifier[ps] operator[=] identifier[jpsf] operator[SEP] identifier[getPreparedStatement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resultSet] operator[SEP] identifier[getFetchSize] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[ps] operator[SEP] identifier[setFetchSize] operator[SEP] identifier[resultSet] operator[SEP] identifier[getFetchSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[localLogger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[rs] operator[=] identifier[ps] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] identifier[jpsf] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP] identifier[localLogger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[rsmd] operator[=] identifier[rs] operator[SEP] identifier[getMetaData] operator[SEP] operator[SEP] operator[SEP] identifier[columnCount] operator[=] identifier[rsmd] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[=] Keyword[new] identifier[JdbcCpoAttribute] operator[SEP] identifier[columnCount] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[k] operator[=] Other[1] operator[SEP] identifier[k] operator[<=] identifier[columnCount] operator[SEP] identifier[k] operator[++] operator[SEP] {
identifier[attributes] operator[SEP] identifier[k] operator[SEP] operator[=] operator[SEP] identifier[JdbcCpoAttribute] operator[SEP] identifier[resultClass] operator[SEP] identifier[getAttributeData] operator[SEP] identifier[rsmd] operator[SEP] identifier[getColumnLabel] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[obj] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[result] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[iae] operator[SEP] {
identifier[localLogger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[result] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CpoException] operator[SEP] literal[String] , identifier[iae] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[iae] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CpoException] operator[SEP] literal[String] , identifier[iae] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[k] operator[=] Other[1] operator[SEP] identifier[k] operator[<=] identifier[columnCount] operator[SEP] identifier[k] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[attributes] operator[SEP] identifier[k] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[attributes] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[invokeSetter] operator[SEP] identifier[obj] , Keyword[new] identifier[ResultSetCpoData] operator[SEP] identifier[JdbcMethodMapper] operator[SEP] identifier[getMethodMapper] operator[SEP] operator[SEP] , identifier[rs] , identifier[attributes] operator[SEP] identifier[k] operator[SEP] , identifier[k] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[try] {
identifier[resultSet] operator[SEP] identifier[put] operator[SEP] identifier[obj] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
identifier[localLogger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
identifier[resultSetClose] operator[SEP] identifier[rs] operator[SEP] operator[SEP] identifier[statementClose] operator[SEP] identifier[ps] operator[SEP] operator[SEP] identifier[localLogger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[resultSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[criteria] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[JdbcCpoAdapter] operator[SEP] identifier[LIST_GROUP] operator[+] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[result] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[SEP] identifier[localLogger] operator[SEP] identifier[error] operator[SEP] identifier[msg] , identifier[t] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CpoException] operator[SEP] identifier[msg] , identifier[t] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[resultSetClose] operator[SEP] identifier[rs] operator[SEP] operator[SEP] identifier[statementClose] operator[SEP] identifier[ps] operator[SEP] operator[SEP]
}
}
|
public ArrayList<OvhLinePhone> line_offer_phones_GET(OvhNumberCountryEnum country, String offer) throws IOException {
String qPath = "/telephony/line/offer/phones";
StringBuilder sb = path(qPath);
query(sb, "country", country);
query(sb, "offer", offer);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, t8);
} | class class_name[name] begin[{]
method[line_offer_phones_GET, return_type[type[ArrayList]], modifier[public], parameter[country, offer]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
call[.query, parameter[member[.sb], literal["country"], member[.country]]]
call[.query, parameter[member[.sb], literal["offer"], member[.offer]]]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], member[.t8]]]]
end[}]
END[}] | Keyword[public] identifier[ArrayList] operator[<] identifier[OvhLinePhone] operator[>] identifier[line_offer_phones_GET] operator[SEP] identifier[OvhNumberCountryEnum] identifier[country] , identifier[String] identifier[offer] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[country] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[offer] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[execN] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[t8] operator[SEP] operator[SEP]
}
|
@Override
public ZMatrixRMaj getUpper(ZMatrixRMaj upper )
{
int numRows = LU.numRows < LU.numCols ? LU.numRows : LU.numCols;
int numCols = LU.numCols;
upper = UtilDecompositons_ZDRM.checkZerosLT(upper, numRows,numCols);
for( int i = 0; i < numRows; i++ ) {
for( int j = i; j < numCols; j++ ) {
int indexLU = LU.getIndex(i,j);
int indexU = upper.getIndex(i,j);
double real = LU.data[indexLU];
double imaginary = LU.data[indexLU+1];
upper.data[indexU] = real;
upper.data[indexU+1] = imaginary;
}
}
return upper;
} | class class_name[name] begin[{]
method[getUpper, return_type[type[ZMatrixRMaj]], modifier[public], parameter[upper]] begin[{]
local_variable[type[int], numRows]
local_variable[type[int], numCols]
assign[member[.upper], call[UtilDecompositons_ZDRM.checkZerosLT, parameter[member[.upper], member[.numRows], member[.numCols]]]]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=LU, selectors=[], type_arguments=None), name=indexLU)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=upper, selectors=[], type_arguments=None), name=indexU)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=LU, selectors=[ArraySelector(index=MemberReference(member=indexLU, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=real)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=LU, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=indexLU, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), name=imaginary)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=upper, selectors=[ArraySelector(index=MemberReference(member=indexU, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=real, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=upper, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=indexU, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), type==, value=MemberReference(member=imaginary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), 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=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.upper]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ZMatrixRMaj] identifier[getUpper] operator[SEP] identifier[ZMatrixRMaj] identifier[upper] operator[SEP] {
Keyword[int] identifier[numRows] operator[=] identifier[LU] operator[SEP] identifier[numRows] operator[<] identifier[LU] operator[SEP] identifier[numCols] operator[?] identifier[LU] operator[SEP] identifier[numRows] operator[:] identifier[LU] operator[SEP] identifier[numCols] operator[SEP] Keyword[int] identifier[numCols] operator[=] identifier[LU] operator[SEP] identifier[numCols] operator[SEP] identifier[upper] operator[=] identifier[UtilDecompositons_ZDRM] operator[SEP] identifier[checkZerosLT] operator[SEP] identifier[upper] , identifier[numRows] , identifier[numCols] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numRows] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[i] operator[SEP] identifier[j] operator[<] identifier[numCols] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[int] identifier[indexLU] operator[=] identifier[LU] operator[SEP] identifier[getIndex] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] Keyword[int] identifier[indexU] operator[=] identifier[upper] operator[SEP] identifier[getIndex] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[real] operator[=] identifier[LU] operator[SEP] identifier[data] operator[SEP] identifier[indexLU] operator[SEP] operator[SEP] Keyword[double] identifier[imaginary] operator[=] identifier[LU] operator[SEP] identifier[data] operator[SEP] identifier[indexLU] operator[+] Other[1] operator[SEP] operator[SEP] identifier[upper] operator[SEP] identifier[data] operator[SEP] identifier[indexU] operator[SEP] operator[=] identifier[real] operator[SEP] identifier[upper] operator[SEP] identifier[data] operator[SEP] identifier[indexU] operator[+] Other[1] operator[SEP] operator[=] identifier[imaginary] operator[SEP]
}
}
Keyword[return] identifier[upper] operator[SEP]
}
|
public static void visitTree(Simon simon, SimonVisitor visitor) throws IOException {
visitor.visit(simon);
for (Simon childSimon : simon.getChildren()) {
visitTree(childSimon, visitor);
}
} | class class_name[name] begin[{]
method[visitTree, return_type[void], modifier[public static], parameter[simon, visitor]] begin[{]
call[visitor.visit, parameter[member[.simon]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=childSimon, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=visitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitTree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=simon, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=childSimon)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Simon, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[visitTree] operator[SEP] identifier[Simon] identifier[simon] , identifier[SimonVisitor] identifier[visitor] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[visitor] operator[SEP] identifier[visit] operator[SEP] identifier[simon] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Simon] identifier[childSimon] operator[:] identifier[simon] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] {
identifier[visitTree] operator[SEP] identifier[childSimon] , identifier[visitor] operator[SEP] operator[SEP]
}
}
|
public static BaseFunction typeErrorThrower(Context cx) {
if (cx.typeErrorThrower == null) {
BaseFunction thrower = new BaseFunction() {
private static final long serialVersionUID = -5891740962154902286L;
@Override
public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) {
throw typeError0("msg.op.not.allowed");
}
@Override
public int getLength() {
return 0;
}
};
ScriptRuntime.setFunctionProtoAndParent(thrower, cx.topCallScope);
thrower.preventExtensions();
cx.typeErrorThrower = thrower;
}
return cx.typeErrorThrower;
} | class class_name[name] begin[{]
method[typeErrorThrower, return_type[type[BaseFunction]], modifier[public static], parameter[cx]] begin[{]
if[binary_operation[member[cx.typeErrorThrower], ==, literal[null]]] begin[{]
local_variable[type[BaseFunction], thrower]
call[ScriptRuntime.setFunctionProtoAndParent, parameter[member[.thrower], member[cx.topCallScope]]]
call[thrower.preventExtensions, parameter[]]
assign[member[cx.typeErrorThrower], member[.thrower]]
else begin[{]
None
end[}]
return[member[cx.typeErrorThrower]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BaseFunction] identifier[typeErrorThrower] operator[SEP] identifier[Context] identifier[cx] operator[SEP] {
Keyword[if] operator[SEP] identifier[cx] operator[SEP] identifier[typeErrorThrower] operator[==] Other[null] operator[SEP] {
identifier[BaseFunction] identifier[thrower] operator[=] Keyword[new] identifier[BaseFunction] operator[SEP] operator[SEP] {
Keyword[private] Keyword[static] Keyword[final] Keyword[long] identifier[serialVersionUID] operator[=] operator[-] Other[5891740962154902286L] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[call] operator[SEP] identifier[Context] identifier[cx] , identifier[Scriptable] identifier[scope] , identifier[Scriptable] identifier[thisObj] , identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[SEP] {
Keyword[throw] identifier[typeError0] operator[SEP] literal[String] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[getLength] operator[SEP] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
} operator[SEP] identifier[ScriptRuntime] operator[SEP] identifier[setFunctionProtoAndParent] operator[SEP] identifier[thrower] , identifier[cx] operator[SEP] identifier[topCallScope] operator[SEP] operator[SEP] identifier[thrower] operator[SEP] identifier[preventExtensions] operator[SEP] operator[SEP] operator[SEP] identifier[cx] operator[SEP] identifier[typeErrorThrower] operator[=] identifier[thrower] operator[SEP]
}
Keyword[return] identifier[cx] operator[SEP] identifier[typeErrorThrower] operator[SEP]
}
|
public String pluralize(String word, int number) {
if (number == 1) { return word; }
Matcher matcher = pattern.matcher(word);
if (matcher.matches()) {
String pre = matcher.group(1);
String trimmedWord = matcher.group(2);
String post = matcher.group(3);
String plural = pluralizeInternal(trimmedWord);
if (plural == null) { return fallbackPluralizer.pluralize(word, number); }
return pre + postProcess(trimmedWord, plural) + post;
}
return word;
} | class class_name[name] begin[{]
method[pluralize, return_type[type[String]], modifier[public], parameter[word, number]] begin[{]
if[binary_operation[member[.number], ==, literal[1]]] begin[{]
return[member[.word]]
else begin[{]
None
end[}]
local_variable[type[Matcher], matcher]
if[call[matcher.matches, parameter[]]] begin[{]
local_variable[type[String], pre]
local_variable[type[String], trimmedWord]
local_variable[type[String], post]
local_variable[type[String], plural]
if[binary_operation[member[.plural], ==, literal[null]]] begin[{]
return[call[fallbackPluralizer.pluralize, parameter[member[.word], member[.number]]]]
else begin[{]
None
end[}]
return[binary_operation[binary_operation[member[.pre], +, call[.postProcess, parameter[member[.trimmedWord], member[.plural]]]], +, member[.post]]]
else begin[{]
None
end[}]
return[member[.word]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[pluralize] operator[SEP] identifier[String] identifier[word] , Keyword[int] identifier[number] operator[SEP] {
Keyword[if] operator[SEP] identifier[number] operator[==] Other[1] operator[SEP] {
Keyword[return] identifier[word] operator[SEP]
}
identifier[Matcher] identifier[matcher] operator[=] identifier[pattern] operator[SEP] identifier[matcher] operator[SEP] identifier[word] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[pre] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[trimmedWord] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[String] identifier[post] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[String] identifier[plural] operator[=] identifier[pluralizeInternal] operator[SEP] identifier[trimmedWord] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[plural] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[fallbackPluralizer] operator[SEP] identifier[pluralize] operator[SEP] identifier[word] , identifier[number] operator[SEP] operator[SEP]
}
Keyword[return] identifier[pre] operator[+] identifier[postProcess] operator[SEP] identifier[trimmedWord] , identifier[plural] operator[SEP] operator[+] identifier[post] operator[SEP]
}
Keyword[return] identifier[word] operator[SEP]
}
|
protected Object[] _transform(final Object[] array) {
Object[] result = new Object[array.length];
for (Object object : array) {
ArrayUtils.add(result, transform(object));
}
return result;
} | class class_name[name] begin[{]
method[_transform, return_type[type[Object]], modifier[protected], parameter[array]] begin[{]
local_variable[type[Object], result]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=ArrayUtils, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[protected] identifier[Object] operator[SEP] operator[SEP] identifier[_transform] operator[SEP] Keyword[final] identifier[Object] operator[SEP] operator[SEP] identifier[array] operator[SEP] {
identifier[Object] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[array] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[object] operator[:] identifier[array] operator[SEP] {
identifier[ArrayUtils] operator[SEP] identifier[add] operator[SEP] identifier[result] , identifier[transform] operator[SEP] identifier[object] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public IDependencyParser setDeprelTranslater(String deprelTranslatorPath)
{
deprelTranslater = GlobalObjectPool.get(deprelTranslatorPath);
if (deprelTranslater != null) return this;
IOUtil.LineIterator iterator = new IOUtil.LineIterator(deprelTranslatorPath);
deprelTranslater = new TreeMap<String, String>();
while (iterator.hasNext())
{
String[] args = iterator.next().split("\\s");
deprelTranslater.put(args[0], args[1]);
}
if (deprelTranslater.size() == 0)
{
deprelTranslater = null;
}
GlobalObjectPool.put(deprelTranslatorPath, deprelTranslater);
return this;
} | class class_name[name] begin[{]
method[setDeprelTranslater, return_type[type[IDependencyParser]], modifier[public], parameter[deprelTranslatorPath]] begin[{]
assign[member[.deprelTranslater], call[GlobalObjectPool.get, parameter[member[.deprelTranslatorPath]]]]
if[binary_operation[member[.deprelTranslater], !=, literal[null]]] begin[{]
return[THIS[]]
else begin[{]
None
end[}]
local_variable[type[IOUtil], iterator]
assign[member[.deprelTranslater], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=TreeMap, sub_type=None))]
while[call[iterator.hasNext, parameter[]]] begin[{]
local_variable[type[String], args]
call[deprelTranslater.put, parameter[member[.args], member[.args]]]
end[}]
if[binary_operation[call[deprelTranslater.size, parameter[]], ==, literal[0]]] begin[{]
assign[member[.deprelTranslater], literal[null]]
else begin[{]
None
end[}]
call[GlobalObjectPool.put, parameter[member[.deprelTranslatorPath], member[.deprelTranslater]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[IDependencyParser] identifier[setDeprelTranslater] operator[SEP] identifier[String] identifier[deprelTranslatorPath] operator[SEP] {
identifier[deprelTranslater] operator[=] identifier[GlobalObjectPool] operator[SEP] identifier[get] operator[SEP] identifier[deprelTranslatorPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deprelTranslater] operator[!=] Other[null] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[IOUtil] operator[SEP] identifier[LineIterator] identifier[iterator] operator[=] Keyword[new] identifier[IOUtil] operator[SEP] identifier[LineIterator] operator[SEP] identifier[deprelTranslatorPath] operator[SEP] operator[SEP] identifier[deprelTranslater] operator[=] Keyword[new] identifier[TreeMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[args] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[deprelTranslater] operator[SEP] identifier[put] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] , identifier[args] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[deprelTranslater] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[deprelTranslater] operator[=] Other[null] operator[SEP]
}
identifier[GlobalObjectPool] operator[SEP] identifier[put] operator[SEP] identifier[deprelTranslatorPath] , identifier[deprelTranslater] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static <K,V> Map<K,V> intersect(Map<K,V> left, Map<K,V> right) {
final Map<K,V> ansMap = createSimilarMap(left);
if (right != null && !right.isEmpty()) {
for (Map.Entry<K, V> e1 : left.entrySet()) {
for (Map.Entry<K, V> e2 : right.entrySet()) {
if (DefaultTypeTransformation.compareEqual(e1, e2)) {
ansMap.put(e1.getKey(), e1.getValue());
}
}
}
}
return ansMap;
} | class class_name[name] begin[{]
method[intersect, return_type[type[Map]], modifier[public static], parameter[left, right]] begin[{]
local_variable[type[Map], ansMap]
if[binary_operation[binary_operation[member[.right], !=, literal[null]], &&, call[right.isEmpty, parameter[]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=e1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareEqual, postfix_operators=[], prefix_operators=[], qualifier=DefaultTypeTransformation, selectors=[], 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=e1, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e1, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=ansMap, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=right, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=left, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
else begin[{]
None
end[}]
return[member[.ansMap]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[intersect] operator[SEP] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[left] , identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[right] operator[SEP] {
Keyword[final] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[ansMap] operator[=] identifier[createSimilarMap] operator[SEP] identifier[left] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[right] operator[!=] Other[null] operator[&&] operator[!] identifier[right] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[e1] operator[:] identifier[left] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[e2] operator[:] identifier[right] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[DefaultTypeTransformation] operator[SEP] identifier[compareEqual] operator[SEP] identifier[e1] , identifier[e2] operator[SEP] operator[SEP] {
identifier[ansMap] operator[SEP] identifier[put] operator[SEP] identifier[e1] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[e1] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] identifier[ansMap] operator[SEP]
}
|
public static <T> T createInstance(Class<T> cls) {
Constructor<T> ctor;
try {
ctor = findConstructor(cls);
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException("Class " + cls.getName() +
" has no default (no arg) constructor");
}
try {
return ctor.newInstance();
} catch (Exception e) {
ExceptionUtils.unwrapAndThrowAsIAE(e, "Unable to instantiate class " +
cls.getName() + ": " + e.getMessage());
throw new IllegalArgumentException(e);
}
} | class class_name[name] begin[{]
method[createInstance, return_type[type[T]], modifier[public static], parameter[cls]] begin[{]
local_variable[type[Constructor], ctor]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ctor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=cls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findConstructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Class "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=cls, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has no default (no arg) constructor"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None)
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=ctor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to instantiate class "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=cls, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=unwrapAndThrowAsIAE, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, 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=IllegalArgumentException, 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[static] operator[<] identifier[T] operator[>] identifier[T] identifier[createInstance] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[cls] operator[SEP] {
identifier[Constructor] operator[<] identifier[T] operator[>] identifier[ctor] operator[SEP] Keyword[try] {
identifier[ctor] operator[=] identifier[findConstructor] operator[SEP] identifier[cls] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[cls] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[return] identifier[ctor] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[ExceptionUtils] operator[SEP] identifier[unwrapAndThrowAsIAE] operator[SEP] identifier[e] , literal[String] operator[+] identifier[cls] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public GitService getGitService() throws Exception {
logger.trace("Getting git service.");
latch.await();
readLock.lock();
return git;
} | class class_name[name] begin[{]
method[getGitService, return_type[type[GitService]], modifier[public], parameter[]] begin[{]
call[logger.trace, parameter[literal["Getting git service."]]]
call[latch.await, parameter[]]
call[readLock.lock, parameter[]]
return[member[.git]]
end[}]
END[}] | Keyword[public] identifier[GitService] identifier[getGitService] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[latch] operator[SEP] identifier[await] operator[SEP] operator[SEP] operator[SEP] identifier[readLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[git] operator[SEP]
}
|
ProjectionImpl nowrad(int hoff, float rlat1, float rlon1, float rlat2, float rlon2, float dlat, float dlon, Date dd) {
List<Dimension> dims = new ArrayList<>();
Dimension dimT = new Dimension("time", 1, true, false, false);
ncfile.addDimension(null, dimT);
String timeCoordName = "time";
Variable taxis = new Variable(ncfile, null, null, timeCoordName);
taxis.setDataType(DataType.DOUBLE);
taxis.setDimensions("time");
taxis.addAttribute(new Attribute(CDM.LONG_NAME, "time since base date"));
taxis.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Time.toString()));
double[] tdata = new double[1];
tdata[0] = dd.getTime();
Array dataT = Array.factory(DataType.DOUBLE, new int[] { 1 }, tdata);
taxis.setCachedData(dataT, false);
DateFormatter formatter = new DateFormatter();
taxis.addAttribute(new Attribute(CDM.UNITS, "msecs since " + formatter.toDateTimeStringISO(new Date(0))));
ncfile.addVariable(null, taxis);
dims.add(dimT);
Dimension jDim = new Dimension("lat", numY, true, false, false);
Dimension iDim = new Dimension("lon", numX, true, false, false);
dims.add(jDim);
dims.add(iDim);
ncfile.addDimension(null, iDim);
ncfile.addDimension(null, jDim);
ncfile.addAttribute(null, new Attribute("cdm_data_type", FeatureType.GRID.toString()));
String coordinates = "time lat lon";
Variable v = new Variable(ncfile, null, null, cname);
v.setDataType(DataType.BYTE);
v.setDimensions(dims);
ncfile.addVariable(null, v);
v.addAttribute(new Attribute(CDM.LONG_NAME, ctitle));
v.addAttribute(new Attribute(CDM.SCALE_FACTOR, 5.0f));
v.addAttribute(new Attribute(CDM.MISSING_VALUE, 0));
v.addAttribute(new Attribute(CDM.UNITS, cunit));
v.setSPobject(new Vinfo(numX, numY, hoff));
v.addAttribute(new Attribute(_Coordinate.Axes, coordinates));
// create coordinate variables
Variable xaxis = new Variable(ncfile, null, null, "lon");
xaxis.setDataType(DataType.DOUBLE);
xaxis.setDimensions("lon");
xaxis.addAttribute(new Attribute(CDM.LONG_NAME, "longitude"));
xaxis.addAttribute(new Attribute(CDM.UNITS, "degree"));
xaxis.addAttribute(new Attribute(_Coordinate.AxisType, "Lon"));
double[] data1 = new double[numX];
for (int i = 0; i < numX; i++) {
data1[i] = (double) (rlon1 + i * dlon);
}
Array dataA = Array.factory(DataType.DOUBLE, new int[] { numX }, data1);
xaxis.setCachedData(dataA, false);
ncfile.addVariable(null, xaxis);
Variable yaxis = new Variable(ncfile, null, null, "lat");
yaxis.setDataType(DataType.DOUBLE);
yaxis.setDimensions("lat");
yaxis.addAttribute(new Attribute(CDM.LONG_NAME, "latitude"));
yaxis.addAttribute(new Attribute(CDM.UNITS, "degree"));
yaxis.addAttribute(new Attribute(_Coordinate.AxisType, "Lat"));
data1 = new double[numY];
for (int i = 0; i < numY; i++) {
data1[i] = rlat1 + i * dlat;
}
dataA = Array.factory(DataType.DOUBLE, new int[] { numY }, data1);
yaxis.setCachedData(dataA, false);
ncfile.addVariable(null, yaxis);
// projection
// lower left and upper right corner lat/lons
// modified cylind. equidistant or CED with lat/lon ration != 1
/* LatLonProjection llproj = new LatLonProjection("LatitudeLongitudeProjection",
new ProjectionRect(rlat1, rlon1, rlat2, rlon2));
Variable ct = new Variable(ncfile, null, null, llproj.getClassName());
ct.setDataType(DataType.CHAR);
ct.setDimensions("");
List params = llproj.getProjectionParameters();
for (int i = 0; i < params.size(); i++) {
Parameter p = (Parameter) params.get(i);
ct.addAttribute(new Attribute(p));
}
ct.addAttribute(new Attribute(_Coordinate.TransformType, "Projection"));
ct.addAttribute(new Attribute(_Coordinate.Axes, "lat lon"));
// fake data
dataA = Array.factory(DataType.CHAR, new int[] {});
dataA.setChar(dataA.getIndex(), ' ');
ct.setCachedData(dataA, false);
ncfile.addVariable(null, ct);
*/
return null;
} | class class_name[name] begin[{]
method[nowrad, return_type[type[ProjectionImpl]], modifier[default], parameter[hoff, rlat1, rlon1, rlat2, rlon2, dlat, dlon, dd]] begin[{]
local_variable[type[List], dims]
local_variable[type[Dimension], dimT]
call[ncfile.addDimension, parameter[literal[null], member[.dimT]]]
local_variable[type[String], timeCoordName]
local_variable[type[Variable], taxis]
call[taxis.setDataType, parameter[member[DataType.DOUBLE]]]
call[taxis.setDimensions, parameter[literal["time"]]]
call[taxis.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=LONG_NAME, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="time since base date")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
call[taxis.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=AxisType, postfix_operators=[], prefix_operators=[], qualifier=_Coordinate, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=AxisType.Time, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
local_variable[type[double], tdata]
assign[member[.tdata], call[dd.getTime, parameter[]]]
local_variable[type[Array], dataT]
call[taxis.setCachedData, parameter[member[.dataT], literal[false]]]
local_variable[type[DateFormatter], formatter]
call[taxis.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=UNITS, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="msecs since "), operandr=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))], member=toDateTimeStringISO, postfix_operators=[], prefix_operators=[], qualifier=formatter, 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=Attribute, sub_type=None))]]
call[ncfile.addVariable, parameter[literal[null], member[.taxis]]]
call[dims.add, parameter[member[.dimT]]]
local_variable[type[Dimension], jDim]
local_variable[type[Dimension], iDim]
call[dims.add, parameter[member[.jDim]]]
call[dims.add, parameter[member[.iDim]]]
call[ncfile.addDimension, parameter[literal[null], member[.iDim]]]
call[ncfile.addDimension, parameter[literal[null], member[.jDim]]]
call[ncfile.addAttribute, parameter[literal[null], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cdm_data_type"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=FeatureType.GRID, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
local_variable[type[String], coordinates]
local_variable[type[Variable], v]
call[v.setDataType, parameter[member[DataType.BYTE]]]
call[v.setDimensions, parameter[member[.dims]]]
call[ncfile.addVariable, parameter[literal[null], member[.v]]]
call[v.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=LONG_NAME, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), MemberReference(member=ctitle, 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=Attribute, sub_type=None))]]
call[v.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=SCALE_FACTOR, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5.0f)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
call[v.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=MISSING_VALUE, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
call[v.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=UNITS, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), MemberReference(member=cunit, 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=Attribute, sub_type=None))]]
call[v.setSPobject, parameter[ClassCreator(arguments=[MemberReference(member=numX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hoff, 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=Vinfo, sub_type=None))]]
call[v.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=Axes, postfix_operators=[], prefix_operators=[], qualifier=_Coordinate, selectors=[]), MemberReference(member=coordinates, 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=Attribute, sub_type=None))]]
local_variable[type[Variable], xaxis]
call[xaxis.setDataType, parameter[member[DataType.DOUBLE]]]
call[xaxis.setDimensions, parameter[literal["lon"]]]
call[xaxis.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=LONG_NAME, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="longitude")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
call[xaxis.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=UNITS, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="degree")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
call[xaxis.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=AxisType, postfix_operators=[], prefix_operators=[], qualifier=_Coordinate, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Lon")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
local_variable[type[double], data1]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=data1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=MemberReference(member=rlon1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dlon, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), type=BasicType(dimensions=[], name=double))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[Array], dataA]
call[xaxis.setCachedData, parameter[member[.dataA], literal[false]]]
call[ncfile.addVariable, parameter[literal[null], member[.xaxis]]]
local_variable[type[Variable], yaxis]
call[yaxis.setDataType, parameter[member[DataType.DOUBLE]]]
call[yaxis.setDimensions, parameter[literal["lat"]]]
call[yaxis.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=LONG_NAME, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="latitude")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
call[yaxis.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=UNITS, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="degree")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
call[yaxis.addAttribute, parameter[ClassCreator(arguments=[MemberReference(member=AxisType, postfix_operators=[], prefix_operators=[], qualifier=_Coordinate, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Lat")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None))]]
assign[member[.data1], ArrayCreator(dimensions=[MemberReference(member=numY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=data1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=rlat1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dlat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.dataA], call[Array.factory, parameter[member[DataType.DOUBLE], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=numY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), member[.data1]]]]
call[yaxis.setCachedData, parameter[member[.dataA], literal[false]]]
call[ncfile.addVariable, parameter[literal[null], member[.yaxis]]]
return[literal[null]]
end[}]
END[}] | identifier[ProjectionImpl] identifier[nowrad] operator[SEP] Keyword[int] identifier[hoff] , Keyword[float] identifier[rlat1] , Keyword[float] identifier[rlon1] , Keyword[float] identifier[rlat2] , Keyword[float] identifier[rlon2] , Keyword[float] identifier[dlat] , Keyword[float] identifier[dlon] , identifier[Date] identifier[dd] operator[SEP] {
identifier[List] operator[<] identifier[Dimension] operator[>] identifier[dims] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Dimension] identifier[dimT] operator[=] Keyword[new] identifier[Dimension] operator[SEP] literal[String] , Other[1] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addDimension] operator[SEP] Other[null] , identifier[dimT] operator[SEP] operator[SEP] identifier[String] identifier[timeCoordName] operator[=] literal[String] operator[SEP] identifier[Variable] identifier[taxis] operator[=] Keyword[new] identifier[Variable] operator[SEP] identifier[ncfile] , Other[null] , Other[null] , identifier[timeCoordName] operator[SEP] operator[SEP] identifier[taxis] operator[SEP] identifier[setDataType] operator[SEP] identifier[DataType] operator[SEP] identifier[DOUBLE] operator[SEP] operator[SEP] identifier[taxis] operator[SEP] identifier[setDimensions] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[taxis] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[LONG_NAME] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[taxis] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[_Coordinate] operator[SEP] identifier[AxisType] , identifier[AxisType] operator[SEP] identifier[Time] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[tdata] operator[=] Keyword[new] Keyword[double] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[tdata] operator[SEP] Other[0] operator[SEP] operator[=] identifier[dd] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[Array] identifier[dataT] operator[=] identifier[Array] operator[SEP] identifier[factory] operator[SEP] identifier[DataType] operator[SEP] identifier[DOUBLE] , Keyword[new] Keyword[int] operator[SEP] operator[SEP] {
Other[1]
} , identifier[tdata] operator[SEP] operator[SEP] identifier[taxis] operator[SEP] identifier[setCachedData] operator[SEP] identifier[dataT] , literal[boolean] operator[SEP] operator[SEP] identifier[DateFormatter] identifier[formatter] operator[=] Keyword[new] identifier[DateFormatter] operator[SEP] operator[SEP] operator[SEP] identifier[taxis] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[UNITS] , literal[String] operator[+] identifier[formatter] operator[SEP] identifier[toDateTimeStringISO] operator[SEP] Keyword[new] identifier[Date] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addVariable] operator[SEP] Other[null] , identifier[taxis] operator[SEP] operator[SEP] identifier[dims] operator[SEP] identifier[add] operator[SEP] identifier[dimT] operator[SEP] operator[SEP] identifier[Dimension] identifier[jDim] operator[=] Keyword[new] identifier[Dimension] operator[SEP] literal[String] , identifier[numY] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[Dimension] identifier[iDim] operator[=] Keyword[new] identifier[Dimension] operator[SEP] literal[String] , identifier[numX] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[dims] operator[SEP] identifier[add] operator[SEP] identifier[jDim] operator[SEP] operator[SEP] identifier[dims] operator[SEP] identifier[add] operator[SEP] identifier[iDim] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addDimension] operator[SEP] Other[null] , identifier[iDim] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addDimension] operator[SEP] Other[null] , identifier[jDim] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addAttribute] operator[SEP] Other[null] , Keyword[new] identifier[Attribute] operator[SEP] literal[String] , identifier[FeatureType] operator[SEP] identifier[GRID] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[coordinates] operator[=] literal[String] operator[SEP] identifier[Variable] identifier[v] operator[=] Keyword[new] identifier[Variable] operator[SEP] identifier[ncfile] , Other[null] , Other[null] , identifier[cname] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[setDataType] operator[SEP] identifier[DataType] operator[SEP] identifier[BYTE] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[setDimensions] operator[SEP] identifier[dims] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addVariable] operator[SEP] Other[null] , identifier[v] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[LONG_NAME] , identifier[ctitle] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[SCALE_FACTOR] , literal[Float] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[MISSING_VALUE] , Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[UNITS] , identifier[cunit] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[setSPobject] operator[SEP] Keyword[new] identifier[Vinfo] operator[SEP] identifier[numX] , identifier[numY] , identifier[hoff] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[_Coordinate] operator[SEP] identifier[Axes] , identifier[coordinates] operator[SEP] operator[SEP] operator[SEP] identifier[Variable] identifier[xaxis] operator[=] Keyword[new] identifier[Variable] operator[SEP] identifier[ncfile] , Other[null] , Other[null] , literal[String] operator[SEP] operator[SEP] identifier[xaxis] operator[SEP] identifier[setDataType] operator[SEP] identifier[DataType] operator[SEP] identifier[DOUBLE] operator[SEP] operator[SEP] identifier[xaxis] operator[SEP] identifier[setDimensions] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[xaxis] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[LONG_NAME] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[xaxis] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[UNITS] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[xaxis] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[_Coordinate] operator[SEP] identifier[AxisType] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[data1] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numX] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numX] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[data1] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[rlon1] operator[+] identifier[i] operator[*] identifier[dlon] operator[SEP] operator[SEP]
}
identifier[Array] identifier[dataA] operator[=] identifier[Array] operator[SEP] identifier[factory] operator[SEP] identifier[DataType] operator[SEP] identifier[DOUBLE] , Keyword[new] Keyword[int] operator[SEP] operator[SEP] {
identifier[numX]
} , identifier[data1] operator[SEP] operator[SEP] identifier[xaxis] operator[SEP] identifier[setCachedData] operator[SEP] identifier[dataA] , literal[boolean] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addVariable] operator[SEP] Other[null] , identifier[xaxis] operator[SEP] operator[SEP] identifier[Variable] identifier[yaxis] operator[=] Keyword[new] identifier[Variable] operator[SEP] identifier[ncfile] , Other[null] , Other[null] , literal[String] operator[SEP] operator[SEP] identifier[yaxis] operator[SEP] identifier[setDataType] operator[SEP] identifier[DataType] operator[SEP] identifier[DOUBLE] operator[SEP] operator[SEP] identifier[yaxis] operator[SEP] identifier[setDimensions] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[yaxis] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[LONG_NAME] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[yaxis] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[CDM] operator[SEP] identifier[UNITS] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[yaxis] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] identifier[_Coordinate] operator[SEP] identifier[AxisType] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[data1] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numY] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numY] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[data1] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[rlat1] operator[+] identifier[i] operator[*] identifier[dlat] operator[SEP]
}
identifier[dataA] operator[=] identifier[Array] operator[SEP] identifier[factory] operator[SEP] identifier[DataType] operator[SEP] identifier[DOUBLE] , Keyword[new] Keyword[int] operator[SEP] operator[SEP] {
identifier[numY]
} , identifier[data1] operator[SEP] operator[SEP] identifier[yaxis] operator[SEP] identifier[setCachedData] operator[SEP] identifier[dataA] , literal[boolean] operator[SEP] operator[SEP] identifier[ncfile] operator[SEP] identifier[addVariable] operator[SEP] Other[null] , identifier[yaxis] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public static void binary(Image srcImage, ImageOutputStream destImageStream, String imageType) throws IORuntimeException {
write(binary(srcImage), imageType, destImageStream);
} | class class_name[name] begin[{]
method[binary, return_type[void], modifier[public static], parameter[srcImage, destImageStream, imageType]] begin[{]
call[.write, parameter[call[.binary, parameter[member[.srcImage]]], member[.imageType], member[.destImageStream]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[binary] operator[SEP] identifier[Image] identifier[srcImage] , identifier[ImageOutputStream] identifier[destImageStream] , identifier[String] identifier[imageType] operator[SEP] Keyword[throws] identifier[IORuntimeException] {
identifier[write] operator[SEP] identifier[binary] operator[SEP] identifier[srcImage] operator[SEP] , identifier[imageType] , identifier[destImageStream] operator[SEP] operator[SEP]
}
|
public OperationFuture<List<Network>> update(List<Network> networkList, UpdateNetworkConfig config) {
networkList.forEach(network -> update(network, config));
return new OperationFuture<>(networkList, new NoWaitingJobFuture());
} | class class_name[name] begin[{]
method[update, return_type[type[OperationFuture]], modifier[public], parameter[networkList, config]] begin[{]
call[networkList.forEach, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=network, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=network, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
return[ClassCreator(arguments=[MemberReference(member=networkList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoWaitingJobFuture, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=OperationFuture, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[OperationFuture] operator[<] identifier[List] operator[<] identifier[Network] operator[>] operator[>] identifier[update] operator[SEP] identifier[List] operator[<] identifier[Network] operator[>] identifier[networkList] , identifier[UpdateNetworkConfig] identifier[config] operator[SEP] {
identifier[networkList] operator[SEP] identifier[forEach] operator[SEP] identifier[network] operator[->] identifier[update] operator[SEP] identifier[network] , identifier[config] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[OperationFuture] operator[<] operator[>] operator[SEP] identifier[networkList] , Keyword[new] identifier[NoWaitingJobFuture] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Document stringToDom(String xmlSource) throws S2SException {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
return builder.parse(new InputSource(new StringReader(xmlSource)));
}
catch (SAXException | IOException | ParserConfigurationException ex) {
throw new S2SException(ex.getMessage(), ex);
}
} | class class_name[name] begin[{]
method[stringToDom, return_type[type[Document]], modifier[public], parameter[xmlSource]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=DocumentBuilderFactory, selectors=[], type_arguments=None), name=factory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DocumentBuilderFactory, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setNamespaceAware, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newDocumentBuilder, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None), name=builder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DocumentBuilder, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=xmlSource, 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=StringReader, sub_type=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))], member=parse, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MemberReference(member=ex, 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=S2SException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SAXException', 'IOException', 'ParserConfigurationException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[Document] identifier[stringToDom] operator[SEP] identifier[String] identifier[xmlSource] operator[SEP] Keyword[throws] identifier[S2SException] {
Keyword[try] {
identifier[DocumentBuilderFactory] identifier[factory] operator[=] identifier[DocumentBuilderFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[factory] operator[SEP] identifier[setNamespaceAware] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[DocumentBuilder] identifier[builder] operator[=] identifier[factory] operator[SEP] identifier[newDocumentBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[parse] operator[SEP] Keyword[new] identifier[InputSource] operator[SEP] Keyword[new] identifier[StringReader] operator[SEP] identifier[xmlSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SAXException] operator[|] identifier[IOException] operator[|] identifier[ParserConfigurationException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[S2SException] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP]
}
}
|
private void writeFile() throws IOException {
historyFile.delete();
try (FileWriter fw = new FileWriter(historyFile)) {
for(int i=0; i < size();i++)
fw.write(Parser.fromCodePoints(get(i)) + (Config.getLineSeparator()));
}
if (historyFilePermission != null) {
historyFile.setReadable(false, false);
historyFile.setReadable(historyFilePermission.isReadable(), historyFilePermission.isReadableOwnerOnly());
historyFile.setWritable(false, false);
historyFile.setWritable(historyFilePermission.isWritable(), historyFilePermission.isWritableOwnerOnly());
historyFile.setExecutable(false, false);
historyFile.setExecutable(historyFilePermission.isExecutable(),
historyFilePermission.isExecutableOwnerOnly());
}
} | class class_name[name] begin[{]
method[writeFile, return_type[void], modifier[private], parameter[]] begin[{]
call[historyFile.delete, parameter[]]
TryStatement(block=[ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=fromCodePoints, postfix_operators=[], prefix_operators=[], qualifier=Parser, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getLineSeparator, postfix_operators=[], prefix_operators=[], qualifier=Config, selectors=[], type_arguments=None), operator=+)], member=write, postfix_operators=[], prefix_operators=[], qualifier=fw, 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=, 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)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=fw, type=ReferenceType(arguments=None, dimensions=[], name=FileWriter, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=historyFile, 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=FileWriter, sub_type=None)))])
if[binary_operation[member[.historyFilePermission], !=, literal[null]]] begin[{]
call[historyFile.setReadable, parameter[literal[false], literal[false]]]
call[historyFile.setReadable, parameter[call[historyFilePermission.isReadable, parameter[]], call[historyFilePermission.isReadableOwnerOnly, parameter[]]]]
call[historyFile.setWritable, parameter[literal[false], literal[false]]]
call[historyFile.setWritable, parameter[call[historyFilePermission.isWritable, parameter[]], call[historyFilePermission.isWritableOwnerOnly, parameter[]]]]
call[historyFile.setExecutable, parameter[literal[false], literal[false]]]
call[historyFile.setExecutable, parameter[call[historyFilePermission.isExecutable, parameter[]], call[historyFilePermission.isExecutableOwnerOnly, parameter[]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[writeFile] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[historyFile] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[FileWriter] identifier[fw] operator[=] Keyword[new] identifier[FileWriter] operator[SEP] identifier[historyFile] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[fw] operator[SEP] identifier[write] operator[SEP] identifier[Parser] operator[SEP] identifier[fromCodePoints] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[+] operator[SEP] identifier[Config] operator[SEP] identifier[getLineSeparator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[historyFilePermission] operator[!=] Other[null] operator[SEP] {
identifier[historyFile] operator[SEP] identifier[setReadable] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[historyFile] operator[SEP] identifier[setReadable] operator[SEP] identifier[historyFilePermission] operator[SEP] identifier[isReadable] operator[SEP] operator[SEP] , identifier[historyFilePermission] operator[SEP] identifier[isReadableOwnerOnly] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[historyFile] operator[SEP] identifier[setWritable] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[historyFile] operator[SEP] identifier[setWritable] operator[SEP] identifier[historyFilePermission] operator[SEP] identifier[isWritable] operator[SEP] operator[SEP] , identifier[historyFilePermission] operator[SEP] identifier[isWritableOwnerOnly] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[historyFile] operator[SEP] identifier[setExecutable] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[historyFile] operator[SEP] identifier[setExecutable] operator[SEP] identifier[historyFilePermission] operator[SEP] identifier[isExecutable] operator[SEP] operator[SEP] , identifier[historyFilePermission] operator[SEP] identifier[isExecutableOwnerOnly] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static synchronized MCAAuthorizationManager createInstance(Context context) {
if (instance == null) {
instance = new MCAAuthorizationManager(context.getApplicationContext());
instance.bluemixRegionSuffix = BMSClient.getInstance().getBluemixRegionSuffix();
instance.tenantId = BMSClient.getInstance().getBluemixAppGUID();
AuthorizationRequest.setup();
}
return instance;
} | class class_name[name] begin[{]
method[createInstance, return_type[type[MCAAuthorizationManager]], modifier[synchronized public static], parameter[context]] begin[{]
if[binary_operation[member[.instance], ==, literal[null]]] begin[{]
assign[member[.instance], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getApplicationContext, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MCAAuthorizationManager, sub_type=None))]
assign[member[instance.bluemixRegionSuffix], call[BMSClient.getInstance, parameter[]]]
assign[member[instance.tenantId], call[BMSClient.getInstance, parameter[]]]
call[AuthorizationRequest.setup, parameter[]]
else begin[{]
None
end[}]
return[member[.instance]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[synchronized] identifier[MCAAuthorizationManager] identifier[createInstance] operator[SEP] identifier[Context] identifier[context] operator[SEP] {
Keyword[if] operator[SEP] identifier[instance] operator[==] Other[null] operator[SEP] {
identifier[instance] operator[=] Keyword[new] identifier[MCAAuthorizationManager] operator[SEP] identifier[context] operator[SEP] identifier[getApplicationContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[instance] operator[SEP] identifier[bluemixRegionSuffix] operator[=] identifier[BMSClient] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getBluemixRegionSuffix] operator[SEP] operator[SEP] operator[SEP] identifier[instance] operator[SEP] identifier[tenantId] operator[=] identifier[BMSClient] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getBluemixAppGUID] operator[SEP] operator[SEP] operator[SEP] identifier[AuthorizationRequest] operator[SEP] identifier[setup] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[instance] operator[SEP]
}
|
public boolean videoIsMuted() {
boolean isMuted = true;
if (!audioOnly && (null != localStream)) {
for (MediaStreamTrack eachTrack : localStream.videoTracks) {
if (eachTrack.enabled()) {
isMuted = false;
}
}
}
return isMuted;
} | class class_name[name] begin[{]
method[videoIsMuted, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
local_variable[type[boolean], isMuted]
if[binary_operation[member[.audioOnly], &&, binary_operation[literal[null], !=, member[.localStream]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=enabled, postfix_operators=[], prefix_operators=[], qualifier=eachTrack, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isMuted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=videoTracks, postfix_operators=[], prefix_operators=[], qualifier=localStream, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=eachTrack)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MediaStreamTrack, sub_type=None))), label=None)
else begin[{]
None
end[}]
return[member[.isMuted]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[videoIsMuted] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[isMuted] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[audioOnly] operator[&&] operator[SEP] Other[null] operator[!=] identifier[localStream] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[MediaStreamTrack] identifier[eachTrack] operator[:] identifier[localStream] operator[SEP] identifier[videoTracks] operator[SEP] {
Keyword[if] operator[SEP] identifier[eachTrack] operator[SEP] identifier[enabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[isMuted] operator[=] literal[boolean] operator[SEP]
}
}
}
Keyword[return] identifier[isMuted] operator[SEP]
}
|
public void marshall(FileShareInfo fileShareInfo, ProtocolMarshaller protocolMarshaller) {
if (fileShareInfo == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(fileShareInfo.getFileShareType(), FILESHARETYPE_BINDING);
protocolMarshaller.marshall(fileShareInfo.getFileShareARN(), FILESHAREARN_BINDING);
protocolMarshaller.marshall(fileShareInfo.getFileShareId(), FILESHAREID_BINDING);
protocolMarshaller.marshall(fileShareInfo.getFileShareStatus(), FILESHARESTATUS_BINDING);
protocolMarshaller.marshall(fileShareInfo.getGatewayARN(), GATEWAYARN_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[fileShareInfo, protocolMarshaller]] begin[{]
if[binary_operation[member[.fileShareInfo], ==, 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=getFileShareType, postfix_operators=[], prefix_operators=[], qualifier=fileShareInfo, selectors=[], type_arguments=None), MemberReference(member=FILESHARETYPE_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=getFileShareARN, postfix_operators=[], prefix_operators=[], qualifier=fileShareInfo, selectors=[], type_arguments=None), MemberReference(member=FILESHAREARN_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=getFileShareId, postfix_operators=[], prefix_operators=[], qualifier=fileShareInfo, selectors=[], type_arguments=None), MemberReference(member=FILESHAREID_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=getFileShareStatus, postfix_operators=[], prefix_operators=[], qualifier=fileShareInfo, selectors=[], type_arguments=None), MemberReference(member=FILESHARESTATUS_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=getGatewayARN, postfix_operators=[], prefix_operators=[], qualifier=fileShareInfo, selectors=[], type_arguments=None), MemberReference(member=GATEWAYARN_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[FileShareInfo] identifier[fileShareInfo] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[fileShareInfo] 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[fileShareInfo] operator[SEP] identifier[getFileShareType] operator[SEP] operator[SEP] , identifier[FILESHARETYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[fileShareInfo] operator[SEP] identifier[getFileShareARN] operator[SEP] operator[SEP] , identifier[FILESHAREARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[fileShareInfo] operator[SEP] identifier[getFileShareId] operator[SEP] operator[SEP] , identifier[FILESHAREID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[fileShareInfo] operator[SEP] identifier[getFileShareStatus] operator[SEP] operator[SEP] , identifier[FILESHARESTATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[fileShareInfo] operator[SEP] identifier[getGatewayARN] operator[SEP] operator[SEP] , identifier[GATEWAYARN_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static void mixin(Class self, Class[] categoryClass) {
mixin(getMetaClass(self), Arrays.asList(categoryClass));
} | class class_name[name] begin[{]
method[mixin, return_type[void], modifier[public static], parameter[self, categoryClass]] begin[{]
call[.mixin, parameter[call[.getMetaClass, parameter[member[.self]]], call[Arrays.asList, parameter[member[.categoryClass]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[mixin] operator[SEP] identifier[Class] identifier[self] , identifier[Class] operator[SEP] operator[SEP] identifier[categoryClass] operator[SEP] {
identifier[mixin] operator[SEP] identifier[getMetaClass] operator[SEP] identifier[self] operator[SEP] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[categoryClass] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String product(String... factors) {
if (factors == null || factors.length == 0) {
return null;
}
BigDecimal prodcut;
try {
prodcut = new BigDecimal(factors[0]);
for (int i = 1; i < factors.length; i++) {
prodcut = prodcut.multiply(new BigDecimal(factors[i]));
}
return prodcut.toString();
} catch (Exception e) {
return null;
}
} | class class_name[name] begin[{]
method[product, return_type[type[String]], modifier[public static], parameter[factors]] begin[{]
if[binary_operation[binary_operation[member[.factors], ==, literal[null]], ||, binary_operation[member[factors.length], ==, literal[0]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[BigDecimal], prodcut]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prodcut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=factors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prodcut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=factors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=BigDecimal, sub_type=None))], member=multiply, postfix_operators=[], prefix_operators=[], qualifier=prodcut, 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=factors, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=prodcut, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[product] operator[SEP] identifier[String] operator[...] identifier[factors] operator[SEP] {
Keyword[if] operator[SEP] identifier[factors] operator[==] Other[null] operator[||] identifier[factors] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[BigDecimal] identifier[prodcut] operator[SEP] Keyword[try] {
identifier[prodcut] operator[=] Keyword[new] identifier[BigDecimal] operator[SEP] identifier[factors] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[factors] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[prodcut] operator[=] identifier[prodcut] operator[SEP] identifier[multiply] operator[SEP] Keyword[new] identifier[BigDecimal] operator[SEP] identifier[factors] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[prodcut] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
}
|
public void setDateHeader(String name, long date) {
//throw new IllegalStateException(nls.getString("Illegal.from.included.servlet","Illegal from included servlet"));
logger.logp(Level.FINE, CLASS_NAME,"setDateHeader", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "setDateHeader");
} | class class_name[name] begin[{]
method[setDateHeader, return_type[void], modifier[public], parameter[name, date]] begin[{]
call[logger.logp, parameter[member[Level.FINE], member[.CLASS_NAME], literal["setDateHeader"], call[nls.getString, parameter[literal["Illegal.from.included.servlet"], literal["Illegal from included servlet"]]], literal["setDateHeader"]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setDateHeader] operator[SEP] identifier[String] identifier[name] , Keyword[long] identifier[date] operator[SEP] {
identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , identifier[nls] operator[SEP] identifier[getString] operator[SEP] literal[String] , literal[String] operator[SEP] , literal[String] operator[SEP] operator[SEP]
}
|
public synchronized void clearAllEntries() {
tertiaryTable.putAll(primaryTable);
tertiaryTable.putAll(secondaryTable);
primaryTable.clear();
secondaryTable.clear();
evictStaleEntries();
} | class class_name[name] begin[{]
method[clearAllEntries, return_type[void], modifier[synchronized public], parameter[]] begin[{]
call[tertiaryTable.putAll, parameter[member[.primaryTable]]]
call[tertiaryTable.putAll, parameter[member[.secondaryTable]]]
call[primaryTable.clear, parameter[]]
call[secondaryTable.clear, parameter[]]
call[.evictStaleEntries, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[clearAllEntries] operator[SEP] operator[SEP] {
identifier[tertiaryTable] operator[SEP] identifier[putAll] operator[SEP] identifier[primaryTable] operator[SEP] operator[SEP] identifier[tertiaryTable] operator[SEP] identifier[putAll] operator[SEP] identifier[secondaryTable] operator[SEP] operator[SEP] identifier[primaryTable] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[secondaryTable] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[evictStaleEntries] operator[SEP] operator[SEP] operator[SEP]
}
|
public static long betweenMs(Date beginDate, Date endDate) {
return new DateBetween(beginDate, endDate).between(DateUnit.MS);
} | class class_name[name] begin[{]
method[betweenMs, return_type[type[long]], modifier[public static], parameter[beginDate, endDate]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=beginDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=MS, postfix_operators=[], prefix_operators=[], qualifier=DateUnit, selectors=[])], member=between, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=DateBetween, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[long] identifier[betweenMs] operator[SEP] identifier[Date] identifier[beginDate] , identifier[Date] identifier[endDate] operator[SEP] {
Keyword[return] Keyword[new] identifier[DateBetween] operator[SEP] identifier[beginDate] , identifier[endDate] operator[SEP] operator[SEP] identifier[between] operator[SEP] identifier[DateUnit] operator[SEP] identifier[MS] operator[SEP] operator[SEP]
}
|
public static String map(String url, InputStream in, OutputStream out,
boolean unmapOnOpen, boolean closeOnClose)
{
return map(url, new InputOutputStreamHandler(in, out, closeOnClose));
} | class class_name[name] begin[{]
method[map, return_type[type[String]], modifier[public static], parameter[url, in, out, unmapOnOpen, closeOnClose]] begin[{]
return[call[.map, parameter[member[.url], ClassCreator(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=closeOnClose, 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=InputOutputStreamHandler, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[map] operator[SEP] identifier[String] identifier[url] , identifier[InputStream] identifier[in] , identifier[OutputStream] identifier[out] , Keyword[boolean] identifier[unmapOnOpen] , Keyword[boolean] identifier[closeOnClose] operator[SEP] {
Keyword[return] identifier[map] operator[SEP] identifier[url] , Keyword[new] identifier[InputOutputStreamHandler] operator[SEP] identifier[in] , identifier[out] , identifier[closeOnClose] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case XbasePackage.XCLOSURE__DECLARED_FORMAL_PARAMETERS:
return getDeclaredFormalParameters();
case XbasePackage.XCLOSURE__EXPRESSION:
return getExpression();
case XbasePackage.XCLOSURE__EXPLICIT_SYNTAX:
return isExplicitSyntax();
case XbasePackage.XCLOSURE__IMPLICIT_FORMAL_PARAMETERS:
return getImplicitFormalParameters();
}
return super.eGet(featureID, resolve, coreType);
} | class class_name[name] begin[{]
method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=XCLOSURE__DECLARED_FORMAL_PARAMETERS, postfix_operators=[], prefix_operators=[], qualifier=XbasePackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getDeclaredFormalParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=XCLOSURE__EXPRESSION, postfix_operators=[], prefix_operators=[], qualifier=XbasePackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=XCLOSURE__EXPLICIT_SYNTAX, postfix_operators=[], prefix_operators=[], qualifier=XbasePackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isExplicitSyntax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=XCLOSURE__IMPLICIT_FORMAL_PARAMETERS, postfix_operators=[], prefix_operators=[], qualifier=XbasePackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getImplicitFormalParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[XbasePackage] operator[SEP] identifier[XCLOSURE__DECLARED_FORMAL_PARAMETERS] operator[:] Keyword[return] identifier[getDeclaredFormalParameters] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[XbasePackage] operator[SEP] identifier[XCLOSURE__EXPRESSION] operator[:] Keyword[return] identifier[getExpression] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[XbasePackage] operator[SEP] identifier[XCLOSURE__EXPLICIT_SYNTAX] operator[:] Keyword[return] identifier[isExplicitSyntax] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[XbasePackage] operator[SEP] identifier[XCLOSURE__IMPLICIT_FORMAL_PARAMETERS] operator[:] Keyword[return] identifier[getImplicitFormalParameters] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP]
}
|
public static appfwpolicy[] get(nitro_service service) throws Exception{
appfwpolicy obj = new appfwpolicy();
appfwpolicy[] response = (appfwpolicy[])obj.get_resources(service);
return response;
} | class class_name[name] begin[{]
method[get, return_type[type[appfwpolicy]], modifier[public static], parameter[service]] begin[{]
local_variable[type[appfwpolicy], obj]
local_variable[type[appfwpolicy], response]
return[member[.response]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[appfwpolicy] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[appfwpolicy] identifier[obj] operator[=] Keyword[new] identifier[appfwpolicy] operator[SEP] operator[SEP] operator[SEP] identifier[appfwpolicy] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[appfwpolicy] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case SarlPackage.SARL_SKILL__EXTENDS:
return getExtends();
case SarlPackage.SARL_SKILL__IMPLEMENTS:
return getImplements();
}
return super.eGet(featureID, resolve, coreType);
} | class class_name[name] begin[{]
method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=SARL_SKILL__EXTENDS, postfix_operators=[], prefix_operators=[], qualifier=SarlPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getExtends, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=SARL_SKILL__IMPLEMENTS, postfix_operators=[], prefix_operators=[], qualifier=SarlPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getImplements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[SarlPackage] operator[SEP] identifier[SARL_SKILL__EXTENDS] operator[:] Keyword[return] identifier[getExtends] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[SarlPackage] operator[SEP] identifier[SARL_SKILL__IMPLEMENTS] operator[:] Keyword[return] identifier[getImplements] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP]
}
|
public static Webcam openDefault( int desiredWidth , int desiredHeight) {
Webcam webcam = Webcam.getDefault();
// Webcam doesn't list all available resolutions. Just pass in a custom
// resolution and hope it works
adjustResolution(webcam,desiredWidth,desiredHeight);
webcam.open();
return webcam;
} | class class_name[name] begin[{]
method[openDefault, return_type[type[Webcam]], modifier[public static], parameter[desiredWidth, desiredHeight]] begin[{]
local_variable[type[Webcam], webcam]
call[.adjustResolution, parameter[member[.webcam], member[.desiredWidth], member[.desiredHeight]]]
call[webcam.open, parameter[]]
return[member[.webcam]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Webcam] identifier[openDefault] operator[SEP] Keyword[int] identifier[desiredWidth] , Keyword[int] identifier[desiredHeight] operator[SEP] {
identifier[Webcam] identifier[webcam] operator[=] identifier[Webcam] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[adjustResolution] operator[SEP] identifier[webcam] , identifier[desiredWidth] , identifier[desiredHeight] operator[SEP] operator[SEP] identifier[webcam] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[webcam] operator[SEP]
}
|
private static AssetLink createAssetLinkForText(String text) {
AssetLink assetLink = new AssetLink();
TextAsset textAsset = new TextAsset();
textAsset.setAssetText(text);
assetLink.setAsset(textAsset);
return assetLink;
} | class class_name[name] begin[{]
method[createAssetLinkForText, return_type[type[AssetLink]], modifier[private static], parameter[text]] begin[{]
local_variable[type[AssetLink], assetLink]
local_variable[type[TextAsset], textAsset]
call[textAsset.setAssetText, parameter[member[.text]]]
call[assetLink.setAsset, parameter[member[.textAsset]]]
return[member[.assetLink]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[AssetLink] identifier[createAssetLinkForText] operator[SEP] identifier[String] identifier[text] operator[SEP] {
identifier[AssetLink] identifier[assetLink] operator[=] Keyword[new] identifier[AssetLink] operator[SEP] operator[SEP] operator[SEP] identifier[TextAsset] identifier[textAsset] operator[=] Keyword[new] identifier[TextAsset] operator[SEP] operator[SEP] operator[SEP] identifier[textAsset] operator[SEP] identifier[setAssetText] operator[SEP] identifier[text] operator[SEP] operator[SEP] identifier[assetLink] operator[SEP] identifier[setAsset] operator[SEP] identifier[textAsset] operator[SEP] operator[SEP] Keyword[return] identifier[assetLink] operator[SEP]
}
|
private void getCredentials() {
jcrService.getUserName(new BaseCallback<String>() {
@Override
public void onSuccess(String name) {
showMainForm(name);
}
});
} | class class_name[name] begin[{]
method[getCredentials, return_type[void], modifier[private], parameter[]] begin[{]
call[jcrService.getUserName, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=showMainForm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=name, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=BaseCallback, sub_type=None))]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[getCredentials] operator[SEP] operator[SEP] {
identifier[jcrService] operator[SEP] identifier[getUserName] operator[SEP] Keyword[new] identifier[BaseCallback] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[showMainForm] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public boolean hasPermissionForUser(String user, List<String> permission) {
return hasPermissionForUser(user, permission.toArray(new String[0]));
} | class class_name[name] begin[{]
method[hasPermissionForUser, return_type[type[boolean]], modifier[public], parameter[user, permission]] begin[{]
return[call[.hasPermissionForUser, parameter[member[.user], call[permission.toArray, parameter[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[hasPermissionForUser] operator[SEP] identifier[String] identifier[user] , identifier[List] operator[<] identifier[String] operator[>] identifier[permission] operator[SEP] {
Keyword[return] identifier[hasPermissionForUser] operator[SEP] identifier[user] , identifier[permission] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static NonMaxSuppression nonmax( @Nullable ConfigExtract config ) {
if( config == null )
config = new ConfigExtract();
config.checkValidity();
if( BOverrideFactoryFeatureExtractor.nonmax != null ) {
return BOverrideFactoryFeatureExtractor.nonmax.process(config);
}
NonMaxBlock.Search search;
if (config.useStrictRule) {
if( config.detectMaximums)
if( config.detectMinimums )
search = new NonMaxBlockSearchStrict.MinMax();
else
search = new NonMaxBlockSearchStrict.Max();
else
search = new NonMaxBlockSearchStrict.Min();
} else {
if( config.detectMaximums)
if( config.detectMinimums )
search = new NonMaxBlockSearchRelaxed.MinMax();
else
search = new NonMaxBlockSearchRelaxed.Max();
else
search = new NonMaxBlockSearchRelaxed.Min();
}
// See if the user wants to use threaded code or not
NonMaxBlock alg = BoofConcurrency.USE_CONCURRENT ?
new NonMaxBlock_MT(search) : new NonMaxBlock(search);
alg.setSearchRadius(config.radius);
alg.setThresholdMax(config.threshold);
alg.setThresholdMin(-config.threshold);
alg.setBorder(config.ignoreBorder);
return new WrapperNonMaximumBlock(alg);
} | class class_name[name] begin[{]
method[nonmax, return_type[type[NonMaxSuppression]], modifier[public static], parameter[config]] begin[{]
if[binary_operation[member[.config], ==, literal[null]]] begin[{]
assign[member[.config], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigExtract, sub_type=None))]
else begin[{]
None
end[}]
call[config.checkValidity, parameter[]]
if[binary_operation[member[BOverrideFactoryFeatureExtractor.nonmax], !=, literal[null]]] begin[{]
return[call[BOverrideFactoryFeatureExtractor.nonmax.process, parameter[member[.config]]]]
else begin[{]
None
end[}]
local_variable[type[NonMaxBlock], search]
if[member[config.useStrictRule]] begin[{]
if[member[config.detectMaximums]] begin[{]
if[member[config.detectMinimums]] begin[{]
assign[member[.search], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NonMaxBlockSearchStrict, sub_type=ReferenceType(arguments=None, dimensions=None, name=MinMax, sub_type=None)))]
else begin[{]
assign[member[.search], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NonMaxBlockSearchStrict, sub_type=ReferenceType(arguments=None, dimensions=None, name=Max, sub_type=None)))]
end[}]
else begin[{]
assign[member[.search], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NonMaxBlockSearchStrict, sub_type=ReferenceType(arguments=None, dimensions=None, name=Min, sub_type=None)))]
end[}]
else begin[{]
if[member[config.detectMaximums]] begin[{]
if[member[config.detectMinimums]] begin[{]
assign[member[.search], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NonMaxBlockSearchRelaxed, sub_type=ReferenceType(arguments=None, dimensions=None, name=MinMax, sub_type=None)))]
else begin[{]
assign[member[.search], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NonMaxBlockSearchRelaxed, sub_type=ReferenceType(arguments=None, dimensions=None, name=Max, sub_type=None)))]
end[}]
else begin[{]
assign[member[.search], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NonMaxBlockSearchRelaxed, sub_type=ReferenceType(arguments=None, dimensions=None, name=Min, sub_type=None)))]
end[}]
end[}]
local_variable[type[NonMaxBlock], alg]
call[alg.setSearchRadius, parameter[member[config.radius]]]
call[alg.setThresholdMax, parameter[member[config.threshold]]]
call[alg.setThresholdMin, parameter[member[config.threshold]]]
call[alg.setBorder, parameter[member[config.ignoreBorder]]]
return[ClassCreator(arguments=[MemberReference(member=alg, 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=WrapperNonMaximumBlock, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[NonMaxSuppression] identifier[nonmax] operator[SEP] annotation[@] identifier[Nullable] identifier[ConfigExtract] identifier[config] operator[SEP] {
Keyword[if] operator[SEP] identifier[config] operator[==] Other[null] operator[SEP] identifier[config] operator[=] Keyword[new] identifier[ConfigExtract] operator[SEP] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[checkValidity] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[BOverrideFactoryFeatureExtractor] operator[SEP] identifier[nonmax] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[BOverrideFactoryFeatureExtractor] operator[SEP] identifier[nonmax] operator[SEP] identifier[process] operator[SEP] identifier[config] operator[SEP] operator[SEP]
}
identifier[NonMaxBlock] operator[SEP] identifier[Search] identifier[search] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[useStrictRule] operator[SEP] {
Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[detectMaximums] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[detectMinimums] operator[SEP] identifier[search] operator[=] Keyword[new] identifier[NonMaxBlockSearchStrict] operator[SEP] identifier[MinMax] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[search] operator[=] Keyword[new] identifier[NonMaxBlockSearchStrict] operator[SEP] identifier[Max] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[search] operator[=] Keyword[new] identifier[NonMaxBlockSearchStrict] operator[SEP] identifier[Min] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[detectMaximums] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[detectMinimums] operator[SEP] identifier[search] operator[=] Keyword[new] identifier[NonMaxBlockSearchRelaxed] operator[SEP] identifier[MinMax] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[search] operator[=] Keyword[new] identifier[NonMaxBlockSearchRelaxed] operator[SEP] identifier[Max] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[search] operator[=] Keyword[new] identifier[NonMaxBlockSearchRelaxed] operator[SEP] identifier[Min] operator[SEP] operator[SEP] operator[SEP]
}
identifier[NonMaxBlock] identifier[alg] operator[=] identifier[BoofConcurrency] operator[SEP] identifier[USE_CONCURRENT] operator[?] Keyword[new] identifier[NonMaxBlock_MT] operator[SEP] identifier[search] operator[SEP] operator[:] Keyword[new] identifier[NonMaxBlock] operator[SEP] identifier[search] operator[SEP] operator[SEP] identifier[alg] operator[SEP] identifier[setSearchRadius] operator[SEP] identifier[config] operator[SEP] identifier[radius] operator[SEP] operator[SEP] identifier[alg] operator[SEP] identifier[setThresholdMax] operator[SEP] identifier[config] operator[SEP] identifier[threshold] operator[SEP] operator[SEP] identifier[alg] operator[SEP] identifier[setThresholdMin] operator[SEP] operator[-] identifier[config] operator[SEP] identifier[threshold] operator[SEP] operator[SEP] identifier[alg] operator[SEP] identifier[setBorder] operator[SEP] identifier[config] operator[SEP] identifier[ignoreBorder] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[WrapperNonMaximumBlock] operator[SEP] identifier[alg] operator[SEP] operator[SEP]
}
|
public void put(Object o)
throws InterruptedException
{
synchronized(lock)
{
while (size==maxSize)
lock.wait();
elements[tail]=o;
if(++tail==maxSize)
tail=0;
size++;
lock.notify();
}
} | class class_name[name] begin[{]
method[put, return_type[void], modifier[public], parameter[o]] begin[{]
SYNCHRONIZED[member[.lock]] BEGIN[{]
while[binary_operation[member[.size], ==, member[.maxSize]]] begin[{]
call[lock.wait, parameter[]]
end[}]
assign[member[.elements], member[.o]]
if[binary_operation[member[.tail], ==, member[.maxSize]]] begin[{]
assign[member[.tail], literal[0]]
else begin[{]
None
end[}]
member[.size]
call[lock.notify, parameter[]]
END[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[put] operator[SEP] identifier[Object] identifier[o] operator[SEP] Keyword[throws] identifier[InterruptedException] {
Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] {
Keyword[while] operator[SEP] identifier[size] operator[==] identifier[maxSize] operator[SEP] identifier[lock] operator[SEP] identifier[wait] operator[SEP] operator[SEP] operator[SEP] identifier[elements] operator[SEP] identifier[tail] operator[SEP] operator[=] identifier[o] operator[SEP] Keyword[if] operator[SEP] operator[++] identifier[tail] operator[==] identifier[maxSize] operator[SEP] identifier[tail] operator[=] Other[0] operator[SEP] identifier[size] operator[++] operator[SEP] identifier[lock] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Override
public Integer deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) {
return walChanges.getIntValue(buffer, offset);
} | class class_name[name] begin[{]
method[deserializeFromByteBufferObject, return_type[type[Integer]], modifier[public], parameter[buffer, walChanges, offset]] begin[{]
return[call[walChanges.getIntValue, parameter[member[.buffer], member[.offset]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Integer] identifier[deserializeFromByteBufferObject] operator[SEP] identifier[ByteBuffer] identifier[buffer] , identifier[OWALChanges] identifier[walChanges] , Keyword[int] identifier[offset] operator[SEP] {
Keyword[return] identifier[walChanges] operator[SEP] identifier[getIntValue] operator[SEP] identifier[buffer] , identifier[offset] operator[SEP] operator[SEP]
}
|
public static Op.Type getTypeFromByte(byte type) {
switch (type) {
case OpType.SCALAR:
return Op.Type.SCALAR;
case OpType.SCALAR_BOOL:
return Op.Type.SCALAR_BOOL;
case OpType.BROADCAST:
return Op.Type.BROADCAST;
case OpType.BROADCAST_BOOL:
return Op.Type.BROADCAST_BOOL;
case OpType.TRANSFORM_BOOL:
return Op.Type.TRANSFORM_BOOL;
case OpType.TRANSFORM_FLOAT:
return Op.Type.TRANSFORM_FLOAT;
case OpType.TRANSFORM_SAME:
return Op.Type.TRANSFORM_SAME;
case OpType.TRANSFORM_ANY:
return Op.Type.TRANSFORM_ANY;
case OpType.TRANSFORM_STRICT:
return Op.Type.TRANSFORM_STRICT;
case OpType.REDUCE_BOOL:
return Op.Type.REDUCE_BOOL;
case OpType.REDUCE_LONG:
return Op.Type.REDUCE_LONG;
case OpType.REDUCE_FLOAT:
return Op.Type.REDUCE_FLOAT;
case OpType.REDUCE_SAME:
return Op.Type.REDUCE_SAME;
case OpType.REDUCE_3:
return Op.Type.REDUCE3;
case OpType.INDEX_REDUCE:
return Op.Type.INDEXREDUCE;
case OpType.RANDOM:
return Op.Type.RANDOM;
case OpType.LOGIC:
return Op.Type.META;
case OpType.CUSTOM:
return Op.Type.CUSTOM;
case OpType.PAIRWISE:
return Op.Type.PAIRWISE;
case OpType.PAIRWISE_BOOL:
return Op.Type.PAIRWISE_BOOL;
case OpType.SUMMARYSTATS:
return Op.Type.SUMMARYSTATS;
default:
throw new UnsupportedOperationException("Unknown op type passed in: " + type);
}
} | class class_name[name] begin[{]
method[getTypeFromByte, return_type[type[Op]], modifier[public static], parameter[type]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=SCALAR, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=SCALAR, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=SCALAR_BOOL, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=SCALAR_BOOL, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=BROADCAST, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=BROADCAST, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=BROADCAST_BOOL, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=BROADCAST_BOOL, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=TRANSFORM_BOOL, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TRANSFORM_BOOL, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=TRANSFORM_FLOAT, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TRANSFORM_FLOAT, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=TRANSFORM_SAME, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TRANSFORM_SAME, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=TRANSFORM_ANY, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TRANSFORM_ANY, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=TRANSFORM_STRICT, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TRANSFORM_STRICT, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=REDUCE_BOOL, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=REDUCE_BOOL, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=REDUCE_LONG, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=REDUCE_LONG, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=REDUCE_FLOAT, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=REDUCE_FLOAT, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=REDUCE_SAME, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=REDUCE_SAME, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=REDUCE_3, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=REDUCE3, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=INDEX_REDUCE, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=INDEXREDUCE, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=RANDOM, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=RANDOM, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=LOGIC, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=META, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=CUSTOM, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=CUSTOM, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=PAIRWISE, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=PAIRWISE, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=PAIRWISE_BOOL, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=PAIRWISE_BOOL, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=SUMMARYSTATS, postfix_operators=[], prefix_operators=[], qualifier=OpType, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=SUMMARYSTATS, postfix_operators=[], prefix_operators=[], qualifier=Op.Type, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown op type passed in: "), operandr=MemberReference(member=type, 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=UnsupportedOperationException, sub_type=None)), label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Op] operator[SEP] identifier[Type] identifier[getTypeFromByte] operator[SEP] Keyword[byte] identifier[type] operator[SEP] {
Keyword[switch] operator[SEP] identifier[type] operator[SEP] {
Keyword[case] identifier[OpType] operator[SEP] identifier[SCALAR] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[SCALAR] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[SCALAR_BOOL] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[SCALAR_BOOL] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[BROADCAST] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[BROADCAST] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[BROADCAST_BOOL] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[BROADCAST_BOOL] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[TRANSFORM_BOOL] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[TRANSFORM_BOOL] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[TRANSFORM_FLOAT] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[TRANSFORM_FLOAT] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[TRANSFORM_SAME] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[TRANSFORM_SAME] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[TRANSFORM_ANY] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[TRANSFORM_ANY] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[TRANSFORM_STRICT] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[TRANSFORM_STRICT] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[REDUCE_BOOL] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[REDUCE_BOOL] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[REDUCE_LONG] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[REDUCE_LONG] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[REDUCE_FLOAT] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[REDUCE_FLOAT] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[REDUCE_SAME] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[REDUCE_SAME] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[REDUCE_3] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[REDUCE3] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[INDEX_REDUCE] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[INDEXREDUCE] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[RANDOM] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[RANDOM] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[LOGIC] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[META] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[CUSTOM] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[CUSTOM] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[PAIRWISE] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[PAIRWISE] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[PAIRWISE_BOOL] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[PAIRWISE_BOOL] operator[SEP] Keyword[case] identifier[OpType] operator[SEP] identifier[SUMMARYSTATS] operator[:] Keyword[return] identifier[Op] operator[SEP] identifier[Type] operator[SEP] identifier[SUMMARYSTATS] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] identifier[type] operator[SEP] operator[SEP]
}
}
|
public static <S,C extends S> Predicate<S> isInstanceOf(final Class<S> superclazz, final Class<C> clazz) {
return new Predicate<S>() {
public boolean apply(S input) {
return Predicates.instanceOf(clazz).apply(input);
}
};
} | class class_name[name] begin[{]
method[isInstanceOf, return_type[type[Predicate]], modifier[public static], parameter[superclazz, clazz]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=instanceOf, postfix_operators=[], prefix_operators=[], qualifier=Predicates, selectors=[MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=input, type=ReferenceType(arguments=None, dimensions=[], name=S, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None))], dimensions=None, name=Predicate, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[S] , identifier[C] Keyword[extends] identifier[S] operator[>] identifier[Predicate] operator[<] identifier[S] operator[>] identifier[isInstanceOf] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[S] operator[>] identifier[superclazz] , Keyword[final] identifier[Class] operator[<] identifier[C] operator[>] identifier[clazz] operator[SEP] {
Keyword[return] Keyword[new] identifier[Predicate] operator[<] identifier[S] operator[>] operator[SEP] operator[SEP] {
Keyword[public] Keyword[boolean] identifier[apply] operator[SEP] identifier[S] identifier[input] operator[SEP] {
Keyword[return] identifier[Predicates] operator[SEP] identifier[instanceOf] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] identifier[apply] operator[SEP] identifier[input] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
@Override
public UpdateBrokerResult updateBroker(UpdateBrokerRequest request) {
request = beforeClientExecution(request);
return executeUpdateBroker(request);
} | class class_name[name] begin[{]
method[updateBroker, return_type[type[UpdateBrokerResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeUpdateBroker, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[UpdateBrokerResult] identifier[updateBroker] operator[SEP] identifier[UpdateBrokerRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateBroker] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static <K, V> Map.Entry<K, V> immutableEntry(Map.Entry<K, V> entry) {
return new ImmutableEntry<>(entry);
} | class class_name[name] begin[{]
method[immutableEntry, return_type[type[Map]], modifier[public static], parameter[entry]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ImmutableEntry, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[immutableEntry] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[entry] operator[SEP] {
Keyword[return] Keyword[new] identifier[ImmutableEntry] operator[<] operator[>] operator[SEP] identifier[entry] operator[SEP] operator[SEP]
}
|
private DurationDescription getAbsoluteDurationFor(Fraction relativeDuration)
throws IllegalArgumentException {
// This algorithm is closely linked to the way constants are defined
// in the Note class !!!
int absoluteDuration = -1;
byte dotsNumber = 0;
if (!Note.isStrictDuration(m_defaultNoteLength))
throw new IllegalArgumentException("Invalid default note duration "
+ m_defaultNoteLength);
absoluteDuration = m_defaultNoteLength
* relativeDuration.getNumerator();
absoluteDuration = absoluteDuration / relativeDuration.getDenominator();
int remainingDurTmp = 0;
if (absoluteDuration >= 2 * Note.LONG) {
throw new IllegalArgumentException("Cannot calculate the dots for "
+ relativeDuration + " with a default duration equals to "
+ m_defaultNoteLength
+ " : absolute note length was equal to "
+ absoluteDuration);
} else {
short[] durs = new short[] { Note.LONG, Note.BREVE, Note.WHOLE,
Note.HALF, Note.QUARTER, Note.EIGHTH, Note.SIXTEENTH,
Note.THIRTY_SECOND, Note.SIXTY_FOURTH };
for (int i = 0; i < durs.length; i++) {
if (absoluteDuration >= durs[i]) {
remainingDurTmp = absoluteDuration - durs[i];
absoluteDuration = durs[i];
break;
}
}
}
// from here, absDurTemp contains the *real* note duration (without the
// dots) and remainingDurTemp contains the part that should be expressed
// using dots.
if (remainingDurTmp != 0) {
// valuates the number of dots.
int durationRepresentedByDots = 0;
int currentDur = absoluteDuration;
while (durationRepresentedByDots != remainingDurTmp) {
dotsNumber++;
currentDur = currentDur / 2;
durationRepresentedByDots = durationRepresentedByDots
+ currentDur;
if (durationRepresentedByDots > remainingDurTmp)
throw new IllegalArgumentException(
"Cannot calculate the dots for " + relativeDuration
+ " with a default duration equals to "
+ m_defaultNoteLength
+ " : absolute note length was equal to "
+ absoluteDuration);
}
}
return new DurationDescription((short) absoluteDuration, dotsNumber);
} | class class_name[name] begin[{]
method[getAbsoluteDurationFor, return_type[type[DurationDescription]], modifier[private], parameter[relativeDuration]] begin[{]
local_variable[type[int], absoluteDuration]
local_variable[type[byte], dotsNumber]
if[call[Note.isStrictDuration, parameter[member[.m_defaultNoteLength]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid default note duration "), operandr=MemberReference(member=m_defaultNoteLength, 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[}]
assign[member[.absoluteDuration], binary_operation[member[.m_defaultNoteLength], *, call[relativeDuration.getNumerator, parameter[]]]]
assign[member[.absoluteDuration], binary_operation[member[.absoluteDuration], /, call[relativeDuration.getDenominator, parameter[]]]]
local_variable[type[int], remainingDurTmp]
if[binary_operation[member[.absoluteDuration], >=, binary_operation[literal[2], *, member[Note.LONG]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot calculate the dots for "), operandr=MemberReference(member=relativeDuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" with a default duration equals to "), operator=+), operandr=MemberReference(member=m_defaultNoteLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" : absolute note length was equal to "), operator=+), operandr=MemberReference(member=absoluteDuration, 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[{]
local_variable[type[short], durs]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=absoluteDuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=durs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=remainingDurTmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=absoluteDuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=durs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=absoluteDuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=durs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), BreakStatement(goto=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=durs, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
if[binary_operation[member[.remainingDurTmp], !=, literal[0]]] begin[{]
local_variable[type[int], durationRepresentedByDots]
local_variable[type[int], currentDur]
while[binary_operation[member[.durationRepresentedByDots], !=, member[.remainingDurTmp]]] begin[{]
member[.dotsNumber]
assign[member[.currentDur], binary_operation[member[.currentDur], /, literal[2]]]
assign[member[.durationRepresentedByDots], binary_operation[member[.durationRepresentedByDots], +, member[.currentDur]]]
if[binary_operation[member[.durationRepresentedByDots], >, member[.remainingDurTmp]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot calculate the dots for "), operandr=MemberReference(member=relativeDuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" with a default duration equals to "), operator=+), operandr=MemberReference(member=m_defaultNoteLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" : absolute note length was equal to "), operator=+), operandr=MemberReference(member=absoluteDuration, 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[}]
end[}]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[Cast(expression=MemberReference(member=absoluteDuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=short)), MemberReference(member=dotsNumber, 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=DurationDescription, sub_type=None))]
end[}]
END[}] | Keyword[private] identifier[DurationDescription] identifier[getAbsoluteDurationFor] operator[SEP] identifier[Fraction] identifier[relativeDuration] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
Keyword[int] identifier[absoluteDuration] operator[=] operator[-] Other[1] operator[SEP] Keyword[byte] identifier[dotsNumber] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Note] operator[SEP] identifier[isStrictDuration] operator[SEP] identifier[m_defaultNoteLength] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[m_defaultNoteLength] operator[SEP] operator[SEP] identifier[absoluteDuration] operator[=] identifier[m_defaultNoteLength] operator[*] identifier[relativeDuration] operator[SEP] identifier[getNumerator] operator[SEP] operator[SEP] operator[SEP] identifier[absoluteDuration] operator[=] identifier[absoluteDuration] operator[/] identifier[relativeDuration] operator[SEP] identifier[getDenominator] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[remainingDurTmp] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[absoluteDuration] operator[>=] Other[2] operator[*] identifier[Note] operator[SEP] identifier[LONG] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[relativeDuration] operator[+] literal[String] operator[+] identifier[m_defaultNoteLength] operator[+] literal[String] operator[+] identifier[absoluteDuration] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[short] operator[SEP] operator[SEP] identifier[durs] operator[=] Keyword[new] Keyword[short] operator[SEP] operator[SEP] {
identifier[Note] operator[SEP] identifier[LONG] , identifier[Note] operator[SEP] identifier[BREVE] , identifier[Note] operator[SEP] identifier[WHOLE] , identifier[Note] operator[SEP] identifier[HALF] , identifier[Note] operator[SEP] identifier[QUARTER] , identifier[Note] operator[SEP] identifier[EIGHTH] , identifier[Note] operator[SEP] identifier[SIXTEENTH] , identifier[Note] operator[SEP] identifier[THIRTY_SECOND] , identifier[Note] operator[SEP] identifier[SIXTY_FOURTH]
} operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[durs] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[absoluteDuration] operator[>=] identifier[durs] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[remainingDurTmp] operator[=] identifier[absoluteDuration] operator[-] identifier[durs] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[absoluteDuration] operator[=] identifier[durs] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[remainingDurTmp] operator[!=] Other[0] operator[SEP] {
Keyword[int] identifier[durationRepresentedByDots] operator[=] Other[0] operator[SEP] Keyword[int] identifier[currentDur] operator[=] identifier[absoluteDuration] operator[SEP] Keyword[while] operator[SEP] identifier[durationRepresentedByDots] operator[!=] identifier[remainingDurTmp] operator[SEP] {
identifier[dotsNumber] operator[++] operator[SEP] identifier[currentDur] operator[=] identifier[currentDur] operator[/] Other[2] operator[SEP] identifier[durationRepresentedByDots] operator[=] identifier[durationRepresentedByDots] operator[+] identifier[currentDur] operator[SEP] Keyword[if] operator[SEP] identifier[durationRepresentedByDots] operator[>] identifier[remainingDurTmp] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[relativeDuration] operator[+] literal[String] operator[+] identifier[m_defaultNoteLength] operator[+] literal[String] operator[+] identifier[absoluteDuration] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[DurationDescription] operator[SEP] operator[SEP] Keyword[short] operator[SEP] identifier[absoluteDuration] , identifier[dotsNumber] operator[SEP] operator[SEP]
}
|
public static String generateCacheFileFullPath(Uri fileOriginalUri, File cacheDir, long createdTime) {
String source = fileOriginalUri.toString() + Long.toString(createdTime);
String fileName = md5(source);
File cacheFile = new File(cacheDir, fileName);
return cacheFile.getPath();
} | class class_name[name] begin[{]
method[generateCacheFileFullPath, return_type[type[String]], modifier[public static], parameter[fileOriginalUri, cacheDir, createdTime]] begin[{]
local_variable[type[String], source]
local_variable[type[String], fileName]
local_variable[type[File], cacheFile]
return[call[cacheFile.getPath, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[generateCacheFileFullPath] operator[SEP] identifier[Uri] identifier[fileOriginalUri] , identifier[File] identifier[cacheDir] , Keyword[long] identifier[createdTime] operator[SEP] {
identifier[String] identifier[source] operator[=] identifier[fileOriginalUri] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] identifier[Long] operator[SEP] identifier[toString] operator[SEP] identifier[createdTime] operator[SEP] operator[SEP] identifier[String] identifier[fileName] operator[=] identifier[md5] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[File] identifier[cacheFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[cacheDir] , identifier[fileName] operator[SEP] operator[SEP] Keyword[return] identifier[cacheFile] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public Object render(Map<String, Object> context, LNode... nodes) {
// The first node in the array denotes whether this is a for-tag
// over an array, `for item in array ...`, or a for-tag over a
// range, `for i in (4..item.length)`.
boolean array = super.asBoolean(nodes[0].render(context));
String id = super.asString(nodes[1].render(context));
context.put(FORLOOP, new HashMap<String, Object>());
Object rendered = array ? renderArray(id, context, nodes) : renderRange(id, context, nodes);
context.remove(FORLOOP);
return rendered;
} | class class_name[name] begin[{]
method[render, return_type[type[Object]], modifier[public], parameter[context, nodes]] begin[{]
local_variable[type[boolean], array]
local_variable[type[String], id]
call[context.put, parameter[member[.FORLOOP], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]]
local_variable[type[Object], rendered]
call[context.remove, parameter[member[.FORLOOP]]]
return[member[.rendered]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[render] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[context] , identifier[LNode] operator[...] identifier[nodes] operator[SEP] {
Keyword[boolean] identifier[array] operator[=] Keyword[super] operator[SEP] identifier[asBoolean] operator[SEP] identifier[nodes] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[render] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[id] operator[=] Keyword[super] operator[SEP] identifier[asString] operator[SEP] identifier[nodes] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[render] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[put] operator[SEP] identifier[FORLOOP] , Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[rendered] operator[=] identifier[array] operator[?] identifier[renderArray] operator[SEP] identifier[id] , identifier[context] , identifier[nodes] operator[SEP] operator[:] identifier[renderRange] operator[SEP] identifier[id] , identifier[context] , identifier[nodes] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[remove] operator[SEP] identifier[FORLOOP] operator[SEP] operator[SEP] Keyword[return] identifier[rendered] operator[SEP]
}
|
public boolean removeAnnotationInfo(final String annotationClassName) {
final AnnotationInfo existInfo = getAnnotationInfo(annotationClassName);
if(existInfo != null) {
this.annotationInfos.remove(existInfo);
return true;
}
return false;
} | class class_name[name] begin[{]
method[removeAnnotationInfo, return_type[type[boolean]], modifier[public], parameter[annotationClassName]] begin[{]
local_variable[type[AnnotationInfo], existInfo]
if[binary_operation[member[.existInfo], !=, literal[null]]] begin[{]
THIS[member[None.annotationInfos]call[None.remove, parameter[member[.existInfo]]]]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[removeAnnotationInfo] operator[SEP] Keyword[final] identifier[String] identifier[annotationClassName] operator[SEP] {
Keyword[final] identifier[AnnotationInfo] identifier[existInfo] operator[=] identifier[getAnnotationInfo] operator[SEP] identifier[annotationClassName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existInfo] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[annotationInfos] operator[SEP] identifier[remove] operator[SEP] identifier[existInfo] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private boolean validateServer(String host, int port){
if(host==null || host.isEmpty()){
return false;
}
if(port <=0 || port > 65535){
return false;
}
return true;
} | class class_name[name] begin[{]
method[validateServer, return_type[type[boolean]], modifier[private], parameter[host, port]] begin[{]
if[binary_operation[binary_operation[member[.host], ==, literal[null]], ||, call[host.isEmpty, parameter[]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.port], <=, literal[0]], ||, binary_operation[member[.port], >, literal[65535]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[validateServer] operator[SEP] identifier[String] identifier[host] , Keyword[int] identifier[port] operator[SEP] {
Keyword[if] operator[SEP] identifier[host] operator[==] Other[null] operator[||] identifier[host] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[port] operator[<=] Other[0] operator[||] identifier[port] operator[>] Other[65535] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public String getGenre(int type)
{
if (allow(type&ID3V1))
{
return id3v1.getGenreString();
}
if (allow(type&ID3V2))
{
return id3v2.getFrameDataString(ID3v2Frames.CONTENT_TYPE);
}
return null;
} | class class_name[name] begin[{]
method[getGenre, return_type[type[String]], modifier[public], parameter[type]] begin[{]
if[call[.allow, parameter[binary_operation[member[.type], &, member[.ID3V1]]]]] begin[{]
return[call[id3v1.getGenreString, parameter[]]]
else begin[{]
None
end[}]
if[call[.allow, parameter[binary_operation[member[.type], &, member[.ID3V2]]]]] begin[{]
return[call[id3v2.getFrameDataString, parameter[member[ID3v2Frames.CONTENT_TYPE]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getGenre] operator[SEP] Keyword[int] identifier[type] operator[SEP] {
Keyword[if] operator[SEP] identifier[allow] operator[SEP] identifier[type] operator[&] identifier[ID3V1] operator[SEP] operator[SEP] {
Keyword[return] identifier[id3v1] operator[SEP] identifier[getGenreString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[allow] operator[SEP] identifier[type] operator[&] identifier[ID3V2] operator[SEP] operator[SEP] {
Keyword[return] identifier[id3v2] operator[SEP] identifier[getFrameDataString] operator[SEP] identifier[ID3v2Frames] operator[SEP] identifier[CONTENT_TYPE] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public boolean IsOverlapping(FloatRange range) {
return ((isInside(range.min)) || (isInside(range.max)) ||
(range.isInside(min)) || (range.isInside(max)));
} | class class_name[name] begin[{]
method[IsOverlapping, return_type[type[boolean]], modifier[public], parameter[range]] begin[{]
return[binary_operation[binary_operation[binary_operation[call[.isInside, parameter[member[range.min]]], ||, call[.isInside, parameter[member[range.max]]]], ||, call[range.isInside, parameter[member[.min]]]], ||, call[range.isInside, parameter[member[.max]]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[IsOverlapping] operator[SEP] identifier[FloatRange] identifier[range] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[isInside] operator[SEP] identifier[range] operator[SEP] identifier[min] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[isInside] operator[SEP] identifier[range] operator[SEP] identifier[max] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[range] operator[SEP] identifier[isInside] operator[SEP] identifier[min] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[range] operator[SEP] identifier[isInside] operator[SEP] identifier[max] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public synchronized String getGlobalProperty(String name) {
String value = getSystemProperty(name);
if (null == value && globalConfigProperties != null) {
value = globalConfigProperties.getProperty(name);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() && value != null)
Tr.debug(tc, "getGlobalProperty -> " + name + "=" + value);
return value;
} | class class_name[name] begin[{]
method[getGlobalProperty, return_type[type[String]], modifier[synchronized public], parameter[name]] begin[{]
local_variable[type[String], value]
if[binary_operation[binary_operation[literal[null], ==, member[.value]], &&, binary_operation[member[.globalConfigProperties], !=, literal[null]]]] begin[{]
assign[member[.value], call[globalConfigProperties.getProperty, parameter[member[.name]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]], &&, binary_operation[member[.value], !=, literal[null]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[literal["getGlobalProperty -> "], +, member[.name]], +, literal["="]], +, member[.value]]]]
else begin[{]
None
end[}]
return[member[.value]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] identifier[String] identifier[getGlobalProperty] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[String] identifier[value] operator[=] identifier[getSystemProperty] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[value] operator[&&] identifier[globalConfigProperties] operator[!=] Other[null] operator[SEP] {
identifier[value] operator[=] identifier[globalConfigProperties] operator[SEP] identifier[getProperty] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[&&] identifier[value] operator[!=] Other[null] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP]
}
|
public static CompletionStage<Stage> stageOf(final String title, final Pane rootPane) {
return FxAsync.computeOnFxThread(
Tuple.of(title, rootPane),
titleAndPane -> {
final Stage stage = new Stage(StageStyle.DECORATED);
stage.setTitle(title);
stage.setScene(new Scene(rootPane));
return stage;
}
);
} | class class_name[name] begin[{]
method[stageOf, return_type[type[CompletionStage]], modifier[public static], parameter[title, rootPane]] begin[{]
return[call[FxAsync.computeOnFxThread, parameter[call[Tuple.of, parameter[member[.title], member[.rootPane]]], LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=DECORATED, postfix_operators=[], prefix_operators=[], qualifier=StageStyle, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Stage, sub_type=None)), name=stage)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Stage, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=title, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTitle, postfix_operators=[], prefix_operators=[], qualifier=stage, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=rootPane, 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=Scene, sub_type=None))], member=setScene, postfix_operators=[], prefix_operators=[], qualifier=stage, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=stage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], parameters=[MemberReference(member=titleAndPane, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CompletionStage] operator[<] identifier[Stage] operator[>] identifier[stageOf] operator[SEP] Keyword[final] identifier[String] identifier[title] , Keyword[final] identifier[Pane] identifier[rootPane] operator[SEP] {
Keyword[return] identifier[FxAsync] operator[SEP] identifier[computeOnFxThread] operator[SEP] identifier[Tuple] operator[SEP] identifier[of] operator[SEP] identifier[title] , identifier[rootPane] operator[SEP] , identifier[titleAndPane] operator[->] {
Keyword[final] identifier[Stage] identifier[stage] operator[=] Keyword[new] identifier[Stage] operator[SEP] identifier[StageStyle] operator[SEP] identifier[DECORATED] operator[SEP] operator[SEP] identifier[stage] operator[SEP] identifier[setTitle] operator[SEP] identifier[title] operator[SEP] operator[SEP] identifier[stage] operator[SEP] identifier[setScene] operator[SEP] Keyword[new] identifier[Scene] operator[SEP] identifier[rootPane] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[stage] operator[SEP]
} operator[SEP] operator[SEP]
}
|
@Override
public void setParameters(Object[] params) throws CDKException {
if (params.length > 3) throw new CDKException("PartialPiChargeDescriptor only expects three parameter");
if (!(params[0] instanceof Integer)) throw new CDKException("The parameter must be of type Integer");
maxIterations = (Integer) params[0];
if (params.length > 1 && params[1] != null) {
if (!(params[1] instanceof Boolean)) throw new CDKException("The parameter must be of type Boolean");
lpeChecker = (Boolean) params[1];
}
if (params.length > 2 && params[2] != null) {
if (!(params[2] instanceof Integer)) throw new CDKException("The parameter must be of type Integer");
maxResonStruc = (Integer) params[2];
}
} | class class_name[name] begin[{]
method[setParameters, return_type[void], modifier[public], parameter[params]] begin[{]
if[binary_operation[member[params.length], >, literal[3]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PartialPiChargeDescriptor only expects three parameter")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDKException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.params], instanceof, type[Integer]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The parameter must be of type Integer")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDKException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.maxIterations], Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))]
if[binary_operation[binary_operation[member[params.length], >, literal[1]], &&, binary_operation[member[.params], !=, literal[null]]]] begin[{]
if[binary_operation[member[.params], instanceof, type[Boolean]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The parameter must be of type Boolean")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDKException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.lpeChecker], Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[params.length], >, literal[2]], &&, binary_operation[member[.params], !=, literal[null]]]] begin[{]
if[binary_operation[member[.params], instanceof, type[Integer]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The parameter must be of type Integer")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDKException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.maxResonStruc], Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setParameters] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[params] operator[SEP] Keyword[throws] identifier[CDKException] {
Keyword[if] operator[SEP] identifier[params] operator[SEP] identifier[length] operator[>] Other[3] operator[SEP] Keyword[throw] Keyword[new] identifier[CDKException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[params] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[Integer] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CDKException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[maxIterations] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[params] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[params] operator[SEP] identifier[length] operator[>] Other[1] operator[&&] identifier[params] operator[SEP] Other[1] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[params] operator[SEP] Other[1] operator[SEP] Keyword[instanceof] identifier[Boolean] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CDKException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[lpeChecker] operator[=] operator[SEP] identifier[Boolean] operator[SEP] identifier[params] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[params] operator[SEP] identifier[length] operator[>] Other[2] operator[&&] identifier[params] operator[SEP] Other[2] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[params] operator[SEP] Other[2] operator[SEP] Keyword[instanceof] identifier[Integer] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CDKException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[maxResonStruc] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[params] operator[SEP] Other[2] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
@Override
public <TResult> Lazy<TResult> load(Class<TResult> clazz, String id) {
Lazy<Map<String, TResult>> results = _session.lazyLoadInternal(clazz, new String[]{id}, _includes.toArray(new String[0]), null);
return new Lazy(() -> results.getValue().values().iterator().next());
} | class class_name[name] begin[{]
method[load, return_type[type[Lazy]], modifier[public], parameter[clazz, id]] begin[{]
local_variable[type[Lazy], results]
return[ClassCreator(arguments=[LambdaExpression(body=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Lazy, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] operator[<] identifier[TResult] operator[>] identifier[Lazy] operator[<] identifier[TResult] operator[>] identifier[load] operator[SEP] identifier[Class] operator[<] identifier[TResult] operator[>] identifier[clazz] , identifier[String] identifier[id] operator[SEP] {
identifier[Lazy] operator[<] identifier[Map] operator[<] identifier[String] , identifier[TResult] operator[>] operator[>] identifier[results] operator[=] identifier[_session] operator[SEP] identifier[lazyLoadInternal] operator[SEP] identifier[clazz] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[id]
} , identifier[_includes] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Lazy] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[results] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setParam(XExpression newParam)
{
if (newParam != param)
{
NotificationChain msgs = null;
if (param != null)
msgs = ((InternalEObject)param).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM, null, msgs);
if (newParam != null)
msgs = ((InternalEObject)newParam).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM, null, msgs);
msgs = basicSetParam(newParam, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XSYNCHRONIZED_EXPRESSION__PARAM, newParam, newParam));
} | class class_name[name] begin[{]
method[setParam, return_type[void], modifier[public], parameter[newParam]] begin[{]
if[binary_operation[member[.newParam], !=, member[.param]]] begin[{]
local_variable[type[NotificationChain], msgs]
if[binary_operation[member[.param], !=, literal[null]]] begin[{]
assign[member[.msgs], Cast(expression=MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=InternalEObject, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.newParam], !=, literal[null]]] begin[{]
assign[member[.msgs], Cast(expression=MemberReference(member=newParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=InternalEObject, sub_type=None))]
else begin[{]
None
end[}]
assign[member[.msgs], call[.basicSetParam, parameter[member[.newParam], member[.msgs]]]]
if[binary_operation[member[.msgs], !=, literal[null]]] begin[{]
call[msgs.dispatch, parameter[]]
else begin[{]
None
end[}]
else begin[{]
if[call[.eNotificationRequired, parameter[]]] begin[{]
call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=XSYNCHRONIZED_EXPRESSION__PARAM, postfix_operators=[], prefix_operators=[], qualifier=XbasePackage, selectors=[]), MemberReference(member=newParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newParam, 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=ENotificationImpl, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setParam] operator[SEP] identifier[XExpression] identifier[newParam] operator[SEP] {
Keyword[if] operator[SEP] identifier[newParam] operator[!=] identifier[param] operator[SEP] {
identifier[NotificationChain] identifier[msgs] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[param] operator[!=] Other[null] operator[SEP] identifier[msgs] operator[=] operator[SEP] operator[SEP] identifier[InternalEObject] operator[SEP] identifier[param] operator[SEP] operator[SEP] identifier[eInverseRemove] operator[SEP] Keyword[this] , identifier[EOPPOSITE_FEATURE_BASE] operator[-] identifier[XbasePackage] operator[SEP] identifier[XSYNCHRONIZED_EXPRESSION__PARAM] , Other[null] , identifier[msgs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newParam] operator[!=] Other[null] operator[SEP] identifier[msgs] operator[=] operator[SEP] operator[SEP] identifier[InternalEObject] operator[SEP] identifier[newParam] operator[SEP] operator[SEP] identifier[eInverseAdd] operator[SEP] Keyword[this] , identifier[EOPPOSITE_FEATURE_BASE] operator[-] identifier[XbasePackage] operator[SEP] identifier[XSYNCHRONIZED_EXPRESSION__PARAM] , Other[null] , identifier[msgs] operator[SEP] operator[SEP] identifier[msgs] operator[=] identifier[basicSetParam] operator[SEP] identifier[newParam] , identifier[msgs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msgs] operator[!=] Other[null] operator[SEP] identifier[msgs] operator[SEP] identifier[dispatch] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[XbasePackage] operator[SEP] identifier[XSYNCHRONIZED_EXPRESSION__PARAM] , identifier[newParam] , identifier[newParam] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public TraceMethod wayout() {
TraceMethod traceMethod = this.tracer.wayout();
if (getThreadMap().getCurrentStackSize() == 0) {
clearCurrentTracingContext();
if (!TracerFactory.getInstance().offerTracer(this))
System.err.printf("WARNING: Offer failed. Possible queue corruption.%n");
}
return traceMethod;
} | class class_name[name] begin[{]
method[wayout, return_type[type[TraceMethod]], modifier[public], parameter[]] begin[{]
local_variable[type[TraceMethod], traceMethod]
if[binary_operation[call[.getThreadMap, parameter[]], ==, literal[0]]] begin[{]
call[.clearCurrentTracingContext, parameter[]]
if[call[TracerFactory.getInstance, parameter[]]] begin[{]
call[System.err.printf, parameter[literal["WARNING: Offer failed. Possible queue corruption.%n"]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.traceMethod]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[TraceMethod] identifier[wayout] operator[SEP] operator[SEP] {
identifier[TraceMethod] identifier[traceMethod] operator[=] Keyword[this] operator[SEP] identifier[tracer] operator[SEP] identifier[wayout] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getThreadMap] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentStackSize] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[clearCurrentTracingContext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[TracerFactory] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[offerTracer] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[printf] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[traceMethod] operator[SEP]
}
|
@Override
public List<InputSplit> getSplits(JobContext job) throws IOException, InterruptedException {
// load settings from job conf
loadConfig(HadoopCompat.getConfiguration(job));
// find all the index dirs and create a split for each
PriorityQueue<LuceneIndexInputSplit> splits = findSplits(HadoopCompat.getConfiguration(job));
// combine the splits based on maxCombineSplitSize
List<InputSplit> combinedSplits = combineSplits(splits, maxCombinedIndexSizePerSplit,
maxNumIndexesPerSplit);
return combinedSplits;
} | class class_name[name] begin[{]
method[getSplits, return_type[type[List]], modifier[public], parameter[job]] begin[{]
call[.loadConfig, parameter[call[HadoopCompat.getConfiguration, parameter[member[.job]]]]]
local_variable[type[PriorityQueue], splits]
local_variable[type[List], combinedSplits]
return[member[.combinedSplits]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[InputSplit] operator[>] identifier[getSplits] operator[SEP] identifier[JobContext] identifier[job] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] {
identifier[loadConfig] operator[SEP] identifier[HadoopCompat] operator[SEP] identifier[getConfiguration] operator[SEP] identifier[job] operator[SEP] operator[SEP] operator[SEP] identifier[PriorityQueue] operator[<] identifier[LuceneIndexInputSplit] operator[>] identifier[splits] operator[=] identifier[findSplits] operator[SEP] identifier[HadoopCompat] operator[SEP] identifier[getConfiguration] operator[SEP] identifier[job] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[InputSplit] operator[>] identifier[combinedSplits] operator[=] identifier[combineSplits] operator[SEP] identifier[splits] , identifier[maxCombinedIndexSizePerSplit] , identifier[maxNumIndexesPerSplit] operator[SEP] operator[SEP] Keyword[return] identifier[combinedSplits] operator[SEP]
}
|
public void removeUsageParameterSet(SbbID sbbId, String name)
throws NullPointerException, UnrecognizedSbbException,
InvalidArgumentException,
UnrecognizedUsageParameterSetNameException, ManagementException {
if (name == null)
throw new NullPointerException("Sbb usage param set is null");
if (name.length() == 0)
throw new InvalidArgumentException(
"The lenght of the Usage Parameter Set Name is zero!");
if (!isValidUsageParameterName(name))
throw new InvalidArgumentException(
"The lenght of the Usage Parameter Set Name is zero!");
_removeUsageParameterSet(sbbId, name);
} | class class_name[name] begin[{]
method[removeUsageParameterSet, return_type[void], modifier[public], parameter[sbbId, name]] begin[{]
if[binary_operation[member[.name], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Sbb usage param set 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[binary_operation[call[name.length, parameter[]], ==, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The lenght of the Usage Parameter Set Name is zero!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[.isValidUsageParameterName, parameter[member[.name]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The lenght of the Usage Parameter Set Name is zero!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[._removeUsageParameterSet, parameter[member[.sbbId], member[.name]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[removeUsageParameterSet] operator[SEP] identifier[SbbID] identifier[sbbId] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[NullPointerException] , identifier[UnrecognizedSbbException] , identifier[InvalidArgumentException] , identifier[UnrecognizedUsageParameterSetNameException] , identifier[ManagementException] {
Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[InvalidArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isValidUsageParameterName] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InvalidArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[_removeUsageParameterSet] operator[SEP] identifier[sbbId] , identifier[name] operator[SEP] operator[SEP]
}
|
public static int createTargetSupports(IORTransportConfigMetaData tc) {
int supports = 0;
if (tc != null) {
if (!tc.getIntegrity().equals(IORTransportConfigMetaData.INTEGRITY_NONE)) {
supports = supports | Integrity.value;
}
if (!tc.getConfidentiality().equals(IORTransportConfigMetaData.CONFIDENTIALITY_NONE)) {
supports = supports | Confidentiality.value;
}
if (!tc.getDetectMisordering().equalsIgnoreCase(IORTransportConfigMetaData.DETECT_MISORDERING_NONE)) {
supports = supports | DetectMisordering.value;
}
if (!tc.getDetectReplay().equalsIgnoreCase(IORTransportConfigMetaData.DETECT_REPLAY_NONE)) {
supports = supports | DetectReplay.value;
}
if (!tc.getEstablishTrustInTarget().equals(IORTransportConfigMetaData.ESTABLISH_TRUST_IN_TARGET_NONE)) {
supports = supports | EstablishTrustInTarget.value;
}
if (!tc.getEstablishTrustInClient().equals(IORTransportConfigMetaData.ESTABLISH_TRUST_IN_CLIENT_NONE)) {
supports = supports | EstablishTrustInClient.value;
}
}
return supports;
} | class class_name[name] begin[{]
method[createTargetSupports, return_type[type[int]], modifier[public static], parameter[tc]] begin[{]
local_variable[type[int], supports]
if[binary_operation[member[.tc], !=, literal[null]]] begin[{]
if[call[tc.getIntegrity, parameter[]]] begin[{]
assign[member[.supports], binary_operation[member[.supports], |, member[Integrity.value]]]
else begin[{]
None
end[}]
if[call[tc.getConfidentiality, parameter[]]] begin[{]
assign[member[.supports], binary_operation[member[.supports], |, member[Confidentiality.value]]]
else begin[{]
None
end[}]
if[call[tc.getDetectMisordering, parameter[]]] begin[{]
assign[member[.supports], binary_operation[member[.supports], |, member[DetectMisordering.value]]]
else begin[{]
None
end[}]
if[call[tc.getDetectReplay, parameter[]]] begin[{]
assign[member[.supports], binary_operation[member[.supports], |, member[DetectReplay.value]]]
else begin[{]
None
end[}]
if[call[tc.getEstablishTrustInTarget, parameter[]]] begin[{]
assign[member[.supports], binary_operation[member[.supports], |, member[EstablishTrustInTarget.value]]]
else begin[{]
None
end[}]
if[call[tc.getEstablishTrustInClient, parameter[]]] begin[{]
assign[member[.supports], binary_operation[member[.supports], |, member[EstablishTrustInClient.value]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.supports]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[createTargetSupports] operator[SEP] identifier[IORTransportConfigMetaData] identifier[tc] operator[SEP] {
Keyword[int] identifier[supports] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[tc] operator[SEP] identifier[getIntegrity] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[IORTransportConfigMetaData] operator[SEP] identifier[INTEGRITY_NONE] operator[SEP] operator[SEP] {
identifier[supports] operator[=] identifier[supports] operator[|] identifier[Integrity] operator[SEP] identifier[value] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[tc] operator[SEP] identifier[getConfidentiality] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[IORTransportConfigMetaData] operator[SEP] identifier[CONFIDENTIALITY_NONE] operator[SEP] operator[SEP] {
identifier[supports] operator[=] identifier[supports] operator[|] identifier[Confidentiality] operator[SEP] identifier[value] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[tc] operator[SEP] identifier[getDetectMisordering] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[IORTransportConfigMetaData] operator[SEP] identifier[DETECT_MISORDERING_NONE] operator[SEP] operator[SEP] {
identifier[supports] operator[=] identifier[supports] operator[|] identifier[DetectMisordering] operator[SEP] identifier[value] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[tc] operator[SEP] identifier[getDetectReplay] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[IORTransportConfigMetaData] operator[SEP] identifier[DETECT_REPLAY_NONE] operator[SEP] operator[SEP] {
identifier[supports] operator[=] identifier[supports] operator[|] identifier[DetectReplay] operator[SEP] identifier[value] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[tc] operator[SEP] identifier[getEstablishTrustInTarget] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[IORTransportConfigMetaData] operator[SEP] identifier[ESTABLISH_TRUST_IN_TARGET_NONE] operator[SEP] operator[SEP] {
identifier[supports] operator[=] identifier[supports] operator[|] identifier[EstablishTrustInTarget] operator[SEP] identifier[value] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[tc] operator[SEP] identifier[getEstablishTrustInClient] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[IORTransportConfigMetaData] operator[SEP] identifier[ESTABLISH_TRUST_IN_CLIENT_NONE] operator[SEP] operator[SEP] {
identifier[supports] operator[=] identifier[supports] operator[|] identifier[EstablishTrustInClient] operator[SEP] identifier[value] operator[SEP]
}
}
Keyword[return] identifier[supports] operator[SEP]
}
|
String getPid(TaskRunner t) {
if (t != null && t.getTask() != null) {
if (t.getTask().isMapTask()) {
JVMId id = mapJvmManager.runningTaskToJvm.get(t);
if (id != null) {
return mapJvmManager.jvmIdToPid.get(id);
}
} else {
JVMId id = reduceJvmManager.runningTaskToJvm.get(t);
if (id != null) {
return reduceJvmManager.jvmIdToPid.get(id);
}
}
}
return null;
} | class class_name[name] begin[{]
method[getPid, return_type[type[String]], modifier[default], parameter[t]] begin[{]
if[binary_operation[binary_operation[member[.t], !=, literal[null]], &&, binary_operation[call[t.getTask, parameter[]], !=, literal[null]]]] begin[{]
if[call[t.getTask, parameter[]]] begin[{]
local_variable[type[JVMId], id]
if[binary_operation[member[.id], !=, literal[null]]] begin[{]
return[call[mapJvmManager.jvmIdToPid.get, parameter[member[.id]]]]
else begin[{]
None
end[}]
else begin[{]
local_variable[type[JVMId], id]
if[binary_operation[member[.id], !=, literal[null]]] begin[{]
return[call[reduceJvmManager.jvmIdToPid.get, parameter[member[.id]]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | identifier[String] identifier[getPid] operator[SEP] identifier[TaskRunner] identifier[t] operator[SEP] {
Keyword[if] operator[SEP] identifier[t] operator[!=] Other[null] operator[&&] identifier[t] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[t] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[SEP] identifier[isMapTask] operator[SEP] operator[SEP] operator[SEP] {
identifier[JVMId] identifier[id] operator[=] identifier[mapJvmManager] operator[SEP] identifier[runningTaskToJvm] operator[SEP] identifier[get] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[mapJvmManager] operator[SEP] identifier[jvmIdToPid] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[JVMId] identifier[id] operator[=] identifier[reduceJvmManager] operator[SEP] identifier[runningTaskToJvm] operator[SEP] identifier[get] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[reduceJvmManager] operator[SEP] identifier[jvmIdToPid] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP]
}
}
}
Keyword[return] Other[null] operator[SEP]
}
|
@Pure
@Inline(value = "(long) (($1).doubleValue() * $2.MILLIS_IN_SECOND)", imported = {TimeExtensions.class})
public static long seconds(Number secs) {
return (long) (secs.doubleValue() * MILLIS_IN_SECOND);
} | class class_name[name] begin[{]
method[seconds, return_type[type[long]], modifier[public static], parameter[secs]] begin[{]
return[Cast(expression=BinaryOperation(operandl=MethodInvocation(arguments=[], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=secs, selectors=[], type_arguments=None), operandr=MemberReference(member=MILLIS_IN_SECOND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), type=BasicType(dimensions=[], name=long))]
end[}]
END[}] | annotation[@] identifier[Pure] annotation[@] identifier[Inline] operator[SEP] identifier[value] operator[=] literal[String] , identifier[imported] operator[=] {
identifier[TimeExtensions] operator[SEP] Keyword[class]
} operator[SEP] Keyword[public] Keyword[static] Keyword[long] identifier[seconds] operator[SEP] identifier[Number] identifier[secs] operator[SEP] {
Keyword[return] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[secs] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[*] identifier[MILLIS_IN_SECOND] operator[SEP] operator[SEP]
}
|
@Reference(cardinality=ReferenceCardinality.MULTIPLE, policy=ReferencePolicy.DYNAMIC)
public void addFactory(ConfigurationsProvider factory) {
if (logger.isLoggable(Level.FINER)) {
logger.finer("Adding factory: " + factory);
}
providers.add(factory);
} | class class_name[name] begin[{]
method[addFactory, return_type[void], modifier[public], parameter[factory]] begin[{]
if[call[logger.isLoggable, parameter[member[Level.FINER]]]] begin[{]
call[logger.finer, parameter[binary_operation[literal["Adding factory: "], +, member[.factory]]]]
else begin[{]
None
end[}]
call[providers.add, parameter[member[.factory]]]
end[}]
END[}] | annotation[@] identifier[Reference] operator[SEP] identifier[cardinality] operator[=] identifier[ReferenceCardinality] operator[SEP] identifier[MULTIPLE] , identifier[policy] operator[=] identifier[ReferencePolicy] operator[SEP] identifier[DYNAMIC] operator[SEP] Keyword[public] Keyword[void] identifier[addFactory] operator[SEP] identifier[ConfigurationsProvider] identifier[factory] operator[SEP] {
Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[finer] operator[SEP] literal[String] operator[+] identifier[factory] operator[SEP] operator[SEP]
}
identifier[providers] operator[SEP] identifier[add] operator[SEP] identifier[factory] operator[SEP] operator[SEP]
}
|
public static BufferedImage resizeScreenshotIfNeeded(WebDriver driver, BufferedImage screenshotImage) {
Double devicePixelRatio = 1.0;
try {
devicePixelRatio = ((Number) ((JavascriptExecutor) driver).executeScript(JS_RETRIEVE_DEVICE_PIXEL_RATIO)).doubleValue();
} catch (Exception ex) {
ex.printStackTrace();
}
if (devicePixelRatio > 1.0 && screenshotImage.getWidth() > 0) {
Long screenSize = ((Number) ((JavascriptExecutor) driver).executeScript("return Math.max(" +
"document.body.scrollWidth, document.documentElement.scrollWidth," +
"document.body.offsetWidth, document.documentElement.offsetWidth," +
"document.body.clientWidth, document.documentElement.clientWidth);"
)).longValue();
Double estimatedPixelRatio = ((double)screenshotImage.getWidth()) / ((double)screenSize);
if (estimatedPixelRatio > 1.0) {
int newWidth = (int) (screenshotImage.getWidth() / estimatedPixelRatio);
int newHeight = (int) (screenshotImage.getHeight() / estimatedPixelRatio);
Image tmp = screenshotImage.getScaledInstance(newWidth, newHeight, Image.SCALE_SMOOTH);
BufferedImage scaledImage = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = scaledImage.createGraphics();
g2d.drawImage(tmp, 0, 0, null);
g2d.dispose();
return scaledImage;
}
else return screenshotImage;
}
else return screenshotImage;
} | class class_name[name] begin[{]
method[resizeScreenshotIfNeeded, return_type[type[BufferedImage]], modifier[public static], parameter[driver, screenshotImage]] begin[{]
local_variable[type[Double], devicePixelRatio]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=devicePixelRatio, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=Cast(expression=MemberReference(member=driver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JavascriptExecutor, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None)
if[binary_operation[binary_operation[member[.devicePixelRatio], >, literal[1.0]], &&, binary_operation[call[screenshotImage.getWidth, parameter[]], >, literal[0]]]] begin[{]
local_variable[type[Long], screenSize]
local_variable[type[Double], estimatedPixelRatio]
if[binary_operation[member[.estimatedPixelRatio], >, literal[1.0]]] begin[{]
local_variable[type[int], newWidth]
local_variable[type[int], newHeight]
local_variable[type[Image], tmp]
local_variable[type[BufferedImage], scaledImage]
local_variable[type[Graphics2D], g2d]
call[g2d.drawImage, parameter[member[.tmp], literal[0], literal[0], literal[null]]]
call[g2d.dispose, parameter[]]
return[member[.scaledImage]]
else begin[{]
return[member[.screenshotImage]]
end[}]
else begin[{]
return[member[.screenshotImage]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BufferedImage] identifier[resizeScreenshotIfNeeded] operator[SEP] identifier[WebDriver] identifier[driver] , identifier[BufferedImage] identifier[screenshotImage] operator[SEP] {
identifier[Double] identifier[devicePixelRatio] operator[=] literal[Float] operator[SEP] Keyword[try] {
identifier[devicePixelRatio] operator[=] operator[SEP] operator[SEP] identifier[Number] operator[SEP] operator[SEP] operator[SEP] identifier[JavascriptExecutor] operator[SEP] identifier[driver] operator[SEP] operator[SEP] identifier[executeScript] operator[SEP] identifier[JS_RETRIEVE_DEVICE_PIXEL_RATIO] operator[SEP] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[devicePixelRatio] operator[>] literal[Float] operator[&&] identifier[screenshotImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[Long] identifier[screenSize] operator[=] operator[SEP] operator[SEP] identifier[Number] operator[SEP] operator[SEP] operator[SEP] identifier[JavascriptExecutor] operator[SEP] identifier[driver] operator[SEP] operator[SEP] identifier[executeScript] operator[SEP] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] identifier[Double] identifier[estimatedPixelRatio] operator[=] operator[SEP] operator[SEP] Keyword[double] operator[SEP] identifier[screenshotImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[/] operator[SEP] operator[SEP] Keyword[double] operator[SEP] identifier[screenSize] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[estimatedPixelRatio] operator[>] literal[Float] operator[SEP] {
Keyword[int] identifier[newWidth] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[screenshotImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[/] identifier[estimatedPixelRatio] operator[SEP] operator[SEP] Keyword[int] identifier[newHeight] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[screenshotImage] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[/] identifier[estimatedPixelRatio] operator[SEP] operator[SEP] identifier[Image] identifier[tmp] operator[=] identifier[screenshotImage] operator[SEP] identifier[getScaledInstance] operator[SEP] identifier[newWidth] , identifier[newHeight] , identifier[Image] operator[SEP] identifier[SCALE_SMOOTH] operator[SEP] operator[SEP] identifier[BufferedImage] identifier[scaledImage] operator[=] Keyword[new] identifier[BufferedImage] operator[SEP] identifier[newWidth] , identifier[newHeight] , identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_RGB] operator[SEP] operator[SEP] identifier[Graphics2D] identifier[g2d] operator[=] identifier[scaledImage] operator[SEP] identifier[createGraphics] operator[SEP] operator[SEP] operator[SEP] identifier[g2d] operator[SEP] identifier[drawImage] operator[SEP] identifier[tmp] , Other[0] , Other[0] , Other[null] operator[SEP] operator[SEP] identifier[g2d] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[scaledImage] operator[SEP]
}
Keyword[else] Keyword[return] identifier[screenshotImage] operator[SEP]
}
Keyword[else] Keyword[return] identifier[screenshotImage] operator[SEP]
}
|
public static void sendErrorMail(String phase, Throwable e, String gMailUsername, String gMailPassword) {
sendErrorMail(phase, null, e, gMailUsername, gMailPassword);
} | class class_name[name] begin[{]
method[sendErrorMail, return_type[void], modifier[public static], parameter[phase, e, gMailUsername, gMailPassword]] begin[{]
call[.sendErrorMail, parameter[member[.phase], literal[null], member[.e], member[.gMailUsername], member[.gMailPassword]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[sendErrorMail] operator[SEP] identifier[String] identifier[phase] , identifier[Throwable] identifier[e] , identifier[String] identifier[gMailUsername] , identifier[String] identifier[gMailPassword] operator[SEP] {
identifier[sendErrorMail] operator[SEP] identifier[phase] , Other[null] , identifier[e] , identifier[gMailUsername] , identifier[gMailPassword] operator[SEP] operator[SEP]
}
|
protected Enumeration/*<URL>*/ findResources(String name,
boolean parentHasBeenSearched)
throws IOException {
Enumeration/*<URL>*/ mine = new ResourceEnumeration(name);
Enumeration/*<URL>*/ base;
if (parent != null && (!parentHasBeenSearched || parent != getParent())) {
// Delegate to the parent:
base = parent.getResources(name);
// Note: could cause overlaps in case
// ClassLoader.this.parent has matches and
// parentHasBeenSearched is true
} else {
// ClassLoader.this.parent is already delegated to for example from
// ClassLoader.getResources, no need:
base = new CollectionUtils.EmptyEnumeration();
}
if (isParentFirst(name)) {
// Normal case.
return CollectionUtils.append(base, mine);
}
if (ignoreBase) {
return getRootLoader() == null ? mine : CollectionUtils.append(mine, getRootLoader()
.getResources(name));
}
// parent last:
return CollectionUtils.append(mine, base);
} | class class_name[name] begin[{]
method[findResources, return_type[type[Enumeration]], modifier[protected], parameter[name, parentHasBeenSearched]] begin[{]
local_variable[type[Enumeration], mine]
local_variable[type[Enumeration], base]
if[binary_operation[binary_operation[member[.parent], !=, literal[null]], &&, binary_operation[member[.parentHasBeenSearched], ||, binary_operation[member[.parent], !=, call[.getParent, parameter[]]]]]] begin[{]
assign[member[.base], call[parent.getResources, parameter[member[.name]]]]
else begin[{]
assign[member[.base], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CollectionUtils, sub_type=ReferenceType(arguments=None, dimensions=None, name=EmptyEnumeration, sub_type=None)))]
end[}]
if[call[.isParentFirst, parameter[member[.name]]]] begin[{]
return[call[CollectionUtils.append, parameter[member[.base], member[.mine]]]]
else begin[{]
None
end[}]
if[member[.ignoreBase]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRootLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=mine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRootLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResources, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=CollectionUtils, selectors=[], type_arguments=None), if_true=MemberReference(member=mine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
else begin[{]
None
end[}]
return[call[CollectionUtils.append, parameter[member[.mine], member[.base]]]]
end[}]
END[}] | Keyword[protected] identifier[Enumeration] identifier[findResources] operator[SEP] identifier[String] identifier[name] , Keyword[boolean] identifier[parentHasBeenSearched] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Enumeration] identifier[mine] operator[=] Keyword[new] identifier[ResourceEnumeration] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[Enumeration] identifier[base] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[&&] operator[SEP] operator[!] identifier[parentHasBeenSearched] operator[||] identifier[parent] operator[!=] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[base] operator[=] identifier[parent] operator[SEP] identifier[getResources] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[base] operator[=] Keyword[new] identifier[CollectionUtils] operator[SEP] identifier[EmptyEnumeration] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isParentFirst] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[return] identifier[CollectionUtils] operator[SEP] identifier[append] operator[SEP] identifier[base] , identifier[mine] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ignoreBase] operator[SEP] {
Keyword[return] identifier[getRootLoader] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] identifier[mine] operator[:] identifier[CollectionUtils] operator[SEP] identifier[append] operator[SEP] identifier[mine] , identifier[getRootLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getResources] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[CollectionUtils] operator[SEP] identifier[append] operator[SEP] identifier[mine] , identifier[base] operator[SEP] operator[SEP]
}
|
public static String lower(EvaluationContext ctx, Object text) {
return Conversions.toString(text, ctx).toLowerCase();
} | class class_name[name] begin[{]
method[lower, return_type[type[String]], modifier[public static], parameter[ctx, text]] begin[{]
return[call[Conversions.toString, parameter[member[.text], member[.ctx]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[lower] operator[SEP] identifier[EvaluationContext] identifier[ctx] , identifier[Object] identifier[text] operator[SEP] {
Keyword[return] identifier[Conversions] operator[SEP] identifier[toString] operator[SEP] identifier[text] , identifier[ctx] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP]
}
|
private boolean checkForMapValue(TabularType pType) {
CompositeType rowType = pType.getRowType();
// Two entries in the row: "key" and "value"
return rowType.containsKey(TD_KEY_VALUE) && rowType.containsKey(TD_KEY_KEY) && rowType.keySet().size() == 2;
} | class class_name[name] begin[{]
method[checkForMapValue, return_type[type[boolean]], modifier[private], parameter[pType]] begin[{]
local_variable[type[CompositeType], rowType]
return[binary_operation[binary_operation[call[rowType.containsKey, parameter[member[.TD_KEY_VALUE]]], &&, call[rowType.containsKey, parameter[member[.TD_KEY_KEY]]]], &&, binary_operation[call[rowType.keySet, parameter[]], ==, literal[2]]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[checkForMapValue] operator[SEP] identifier[TabularType] identifier[pType] operator[SEP] {
identifier[CompositeType] identifier[rowType] operator[=] identifier[pType] operator[SEP] identifier[getRowType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[rowType] operator[SEP] identifier[containsKey] operator[SEP] identifier[TD_KEY_VALUE] operator[SEP] operator[&&] identifier[rowType] operator[SEP] identifier[containsKey] operator[SEP] identifier[TD_KEY_KEY] operator[SEP] operator[&&] identifier[rowType] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[2] operator[SEP]
}
|
public static void sse(@NotNull String path, @NotNull Consumer<SseClient> client) {
staticInstance().sse(prefixPath(path), client);
} | class class_name[name] begin[{]
method[sse, return_type[void], modifier[public static], parameter[path, client]] begin[{]
call[.staticInstance, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[sse] operator[SEP] annotation[@] identifier[NotNull] identifier[String] identifier[path] , annotation[@] identifier[NotNull] identifier[Consumer] operator[<] identifier[SseClient] operator[>] identifier[client] operator[SEP] {
identifier[staticInstance] operator[SEP] operator[SEP] operator[SEP] identifier[sse] operator[SEP] identifier[prefixPath] operator[SEP] identifier[path] operator[SEP] , identifier[client] operator[SEP] operator[SEP]
}
|
public FunctionInputDefBuilder vars( String type, AbstractVarDef... vars)
{
for( AbstractVarDef var : vars)
{
var.setType( type);
functionInputDef_.addVarDef( var);
}
return this;
} | class class_name[name] begin[{]
method[vars, return_type[type[FunctionInputDefBuilder]], modifier[public], parameter[type, vars]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setType, postfix_operators=[], prefix_operators=[], qualifier=var, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addVarDef, postfix_operators=[], prefix_operators=[], qualifier=functionInputDef_, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=vars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=var)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractVarDef, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[FunctionInputDefBuilder] identifier[vars] operator[SEP] identifier[String] identifier[type] , identifier[AbstractVarDef] operator[...] identifier[vars] operator[SEP] {
Keyword[for] operator[SEP] identifier[AbstractVarDef] identifier[var] operator[:] identifier[vars] operator[SEP] {
identifier[var] operator[SEP] identifier[setType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[functionInputDef_] operator[SEP] identifier[addVarDef] operator[SEP] identifier[var] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static Fix deleteExceptions(
MethodTree tree, final VisitorState state, List<ExpressionTree> toDelete) {
List<? extends ExpressionTree> trees = tree.getThrows();
if (toDelete.size() == trees.size()) {
return SuggestedFix.replace(
getThrowsPosition(tree, state) - 1, state.getEndPosition(getLast(trees)), "");
}
String replacement =
FluentIterable.from(tree.getThrows())
.filter(Predicates.not(Predicates.in(toDelete)))
.transform(
new Function<ExpressionTree, String>() {
@Override
@Nullable
public String apply(ExpressionTree input) {
return state.getSourceForNode(input);
}
})
.join(Joiner.on(", "));
return SuggestedFix.replace(
((JCTree) tree.getThrows().get(0)).getStartPosition(),
state.getEndPosition(getLast(tree.getThrows())),
replacement);
} | class class_name[name] begin[{]
method[deleteExceptions, return_type[type[Fix]], modifier[public static], parameter[tree, state, toDelete]] begin[{]
local_variable[type[List], trees]
if[binary_operation[call[toDelete.size, parameter[]], ==, call[trees.size, parameter[]]]] begin[{]
return[call[SuggestedFix.replace, parameter[binary_operation[call[.getThrowsPosition, parameter[member[.tree], member[.state]]], -, literal[1]], call[state.getEndPosition, parameter[call[.getLast, parameter[member[.trees]]]]], literal[""]]]]
else begin[{]
None
end[}]
local_variable[type[String], replacement]
return[call[SuggestedFix.replace, parameter[Cast(expression=MethodInvocation(arguments=[], member=getThrows, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JCTree, sub_type=None)), call[state.getEndPosition, parameter[call[.getLast, parameter[call[tree.getThrows, parameter[]]]]]], member[.replacement]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Fix] identifier[deleteExceptions] operator[SEP] identifier[MethodTree] identifier[tree] , Keyword[final] identifier[VisitorState] identifier[state] , identifier[List] operator[<] identifier[ExpressionTree] operator[>] identifier[toDelete] operator[SEP] {
identifier[List] operator[<] operator[?] Keyword[extends] identifier[ExpressionTree] operator[>] identifier[trees] operator[=] identifier[tree] operator[SEP] identifier[getThrows] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[toDelete] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[trees] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[SuggestedFix] operator[SEP] identifier[replace] operator[SEP] identifier[getThrowsPosition] operator[SEP] identifier[tree] , identifier[state] operator[SEP] operator[-] Other[1] , identifier[state] operator[SEP] identifier[getEndPosition] operator[SEP] identifier[getLast] operator[SEP] identifier[trees] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[replacement] operator[=] identifier[FluentIterable] operator[SEP] identifier[from] operator[SEP] identifier[tree] operator[SEP] identifier[getThrows] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[Predicates] operator[SEP] identifier[not] operator[SEP] identifier[Predicates] operator[SEP] identifier[in] operator[SEP] identifier[toDelete] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[transform] operator[SEP] Keyword[new] identifier[Function] operator[<] identifier[ExpressionTree] , identifier[String] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] annotation[@] identifier[Nullable] Keyword[public] identifier[String] identifier[apply] operator[SEP] identifier[ExpressionTree] identifier[input] operator[SEP] {
Keyword[return] identifier[state] operator[SEP] identifier[getSourceForNode] operator[SEP] identifier[input] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[SuggestedFix] operator[SEP] identifier[replace] operator[SEP] operator[SEP] operator[SEP] identifier[JCTree] operator[SEP] identifier[tree] operator[SEP] identifier[getThrows] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[getStartPosition] operator[SEP] operator[SEP] , identifier[state] operator[SEP] identifier[getEndPosition] operator[SEP] identifier[getLast] operator[SEP] identifier[tree] operator[SEP] identifier[getThrows] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , identifier[replacement] operator[SEP] operator[SEP]
}
|
public CollectionAssert hasFlattenedSizeBetween(int lowerBound, int higherBound) {
isNotNull();
int flattenedSize = flattenedSize(0, this.actual);
if (!(flattenedSize >= lowerBound && flattenedSize <= higherBound)) {
failWithMessage("The flattened size <%s> is not between <%s> and <%s>",
flattenedSize, lowerBound, higherBound);
}
return this;
} | class class_name[name] begin[{]
method[hasFlattenedSizeBetween, return_type[type[CollectionAssert]], modifier[public], parameter[lowerBound, higherBound]] begin[{]
call[.isNotNull, parameter[]]
local_variable[type[int], flattenedSize]
if[binary_operation[binary_operation[member[.flattenedSize], >=, member[.lowerBound]], &&, binary_operation[member[.flattenedSize], <=, member[.higherBound]]]] begin[{]
call[.failWithMessage, parameter[literal["The flattened size <%s> is not between <%s> and <%s>"], member[.flattenedSize], member[.lowerBound], member[.higherBound]]]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[CollectionAssert] identifier[hasFlattenedSizeBetween] operator[SEP] Keyword[int] identifier[lowerBound] , Keyword[int] identifier[higherBound] operator[SEP] {
identifier[isNotNull] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[flattenedSize] operator[=] identifier[flattenedSize] operator[SEP] Other[0] , Keyword[this] operator[SEP] identifier[actual] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[flattenedSize] operator[>=] identifier[lowerBound] operator[&&] identifier[flattenedSize] operator[<=] identifier[higherBound] operator[SEP] operator[SEP] {
identifier[failWithMessage] operator[SEP] literal[String] , identifier[flattenedSize] , identifier[lowerBound] , identifier[higherBound] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public CommandLine setUseSimplifiedAtFiles(boolean simplifiedAtFiles) {
getCommandSpec().parser().useSimplifiedAtFiles(simplifiedAtFiles);
for (CommandLine command : getCommandSpec().subcommands().values()) {
command.setUseSimplifiedAtFiles(simplifiedAtFiles);
}
return this;
} | class class_name[name] begin[{]
method[setUseSimplifiedAtFiles, return_type[type[CommandLine]], modifier[public], parameter[simplifiedAtFiles]] begin[{]
call[.getCommandSpec, parameter[]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=simplifiedAtFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setUseSimplifiedAtFiles, postfix_operators=[], prefix_operators=[], qualifier=command, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCommandSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=subcommands, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=values, 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=command)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommandLine, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[CommandLine] identifier[setUseSimplifiedAtFiles] operator[SEP] Keyword[boolean] identifier[simplifiedAtFiles] operator[SEP] {
identifier[getCommandSpec] operator[SEP] operator[SEP] operator[SEP] identifier[parser] operator[SEP] operator[SEP] operator[SEP] identifier[useSimplifiedAtFiles] operator[SEP] identifier[simplifiedAtFiles] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CommandLine] identifier[command] operator[:] identifier[getCommandSpec] operator[SEP] operator[SEP] operator[SEP] identifier[subcommands] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
identifier[command] operator[SEP] identifier[setUseSimplifiedAtFiles] operator[SEP] identifier[simplifiedAtFiles] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public ProfileLocalObject create(String profileName)
throws NullPointerException, IllegalArgumentException,
TransactionRequiredLocalException, ReadOnlyProfileException,
ProfileAlreadyExistsException, CreateException, SLEEException {
sleeContainer.getTransactionManager().mandateTransaction();
checkProfileSpecIsNotReadOnly();
ProfileObjectImpl profileObject = createProfile(profileName);
profileObject.profilePersist();
return profileObject.getProfileLocalObject();
} | class class_name[name] begin[{]
method[create, return_type[type[ProfileLocalObject]], modifier[public], parameter[profileName]] begin[{]
call[sleeContainer.getTransactionManager, parameter[]]
call[.checkProfileSpecIsNotReadOnly, parameter[]]
local_variable[type[ProfileObjectImpl], profileObject]
call[profileObject.profilePersist, parameter[]]
return[call[profileObject.getProfileLocalObject, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[ProfileLocalObject] identifier[create] operator[SEP] identifier[String] identifier[profileName] operator[SEP] Keyword[throws] identifier[NullPointerException] , identifier[IllegalArgumentException] , identifier[TransactionRequiredLocalException] , identifier[ReadOnlyProfileException] , identifier[ProfileAlreadyExistsException] , identifier[CreateException] , identifier[SLEEException] {
identifier[sleeContainer] operator[SEP] identifier[getTransactionManager] operator[SEP] operator[SEP] operator[SEP] identifier[mandateTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[checkProfileSpecIsNotReadOnly] operator[SEP] operator[SEP] operator[SEP] identifier[ProfileObjectImpl] identifier[profileObject] operator[=] identifier[createProfile] operator[SEP] identifier[profileName] operator[SEP] operator[SEP] identifier[profileObject] operator[SEP] identifier[profilePersist] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[profileObject] operator[SEP] identifier[getProfileLocalObject] operator[SEP] operator[SEP] operator[SEP]
}
|
public Vector add(Vector vec) {
x += vec.x;
y += vec.y;
z += vec.z;
return this;
} | class class_name[name] begin[{]
method[add, return_type[type[Vector]], modifier[public], parameter[vec]] begin[{]
assign[member[.x], member[vec.x]]
assign[member[.y], member[vec.y]]
assign[member[.z], member[vec.z]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Vector] identifier[add] operator[SEP] identifier[Vector] identifier[vec] operator[SEP] {
identifier[x] operator[+=] identifier[vec] operator[SEP] identifier[x] operator[SEP] identifier[y] operator[+=] identifier[vec] operator[SEP] identifier[y] operator[SEP] identifier[z] operator[+=] identifier[vec] operator[SEP] identifier[z] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public double togreenw(double rectt, double utco, double gmst) {
double pi = Math.acos(-1.00);
//
// For each occultation ID, its TU and GMST are the same. However, every
// occultation event takes place at gmst+uts, uts is progressively increasing
// with every occultation event.
double utc = (utco + rectt) * 1.0027379093;
gmst = gmst + utc; //in seconds, without eoe correction.
// gmst may be a positive number or may be a negative number.
while (gmst < 0.0) {
gmst = gmst + 86400.00;
}
while (gmst > 86400.00) {
gmst = gmst - 86400.00;
}
// gmst = the Greenwich mean sidereal time.
// This gmst is without the corrections from the equation of equinoxes. For
// GPS/MET applications, the corrections from equation of equinoxes is not
// necessary because of the accurary needed.
return gmst * 2.0 * pi / 86400.0; //!*** This is the THETA in radian.
} | class class_name[name] begin[{]
method[togreenw, return_type[type[double]], modifier[public], parameter[rectt, utco, gmst]] begin[{]
local_variable[type[double], pi]
local_variable[type[double], utc]
assign[member[.gmst], binary_operation[member[.gmst], +, member[.utc]]]
while[binary_operation[member[.gmst], <, literal[0.0]]] begin[{]
assign[member[.gmst], binary_operation[member[.gmst], +, literal[86400.00]]]
end[}]
while[binary_operation[member[.gmst], >, literal[86400.00]]] begin[{]
assign[member[.gmst], binary_operation[member[.gmst], -, literal[86400.00]]]
end[}]
return[binary_operation[binary_operation[binary_operation[member[.gmst], *, literal[2.0]], *, member[.pi]], /, literal[86400.0]]]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[togreenw] operator[SEP] Keyword[double] identifier[rectt] , Keyword[double] identifier[utco] , Keyword[double] identifier[gmst] operator[SEP] {
Keyword[double] identifier[pi] operator[=] identifier[Math] operator[SEP] identifier[acos] operator[SEP] operator[-] literal[Float] operator[SEP] operator[SEP] Keyword[double] identifier[utc] operator[=] operator[SEP] identifier[utco] operator[+] identifier[rectt] operator[SEP] operator[*] literal[Float] operator[SEP] identifier[gmst] operator[=] identifier[gmst] operator[+] identifier[utc] operator[SEP] Keyword[while] operator[SEP] identifier[gmst] operator[<] literal[Float] operator[SEP] {
identifier[gmst] operator[=] identifier[gmst] operator[+] literal[Float] operator[SEP]
}
Keyword[while] operator[SEP] identifier[gmst] operator[>] literal[Float] operator[SEP] {
identifier[gmst] operator[=] identifier[gmst] operator[-] literal[Float] operator[SEP]
}
Keyword[return] identifier[gmst] operator[*] literal[Float] operator[*] identifier[pi] operator[/] literal[Float] operator[SEP]
}
|
public void deleteGeoTable( String tableName ) throws Exception {
String sql = "SELECT DropGeoTable('" + tableName + "');";
try (IHMStatement stmt = mConn.createStatement()) {
stmt.execute(sql);
}
} | class class_name[name] begin[{]
method[deleteGeoTable, return_type[void], modifier[public], parameter[tableName]] begin[{]
local_variable[type[String], sql]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=stmt, type=ReferenceType(arguments=None, dimensions=[], name=IHMStatement, sub_type=None), value=MethodInvocation(arguments=[], member=createStatement, postfix_operators=[], prefix_operators=[], qualifier=mConn, selectors=[], type_arguments=None))])
end[}]
END[}] | Keyword[public] Keyword[void] identifier[deleteGeoTable] operator[SEP] identifier[String] identifier[tableName] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[String] identifier[sql] operator[=] literal[String] operator[+] identifier[tableName] operator[+] literal[String] operator[SEP] Keyword[try] operator[SEP] identifier[IHMStatement] identifier[stmt] operator[=] identifier[mConn] operator[SEP] identifier[createStatement] operator[SEP] operator[SEP] operator[SEP] {
identifier[stmt] operator[SEP] identifier[execute] operator[SEP] identifier[sql] operator[SEP] operator[SEP]
}
}
|
public static RepositoryPackage fromPackageRepository(File input) throws IOException, ParseException {
PackageRepository repo = new PackageRepository(input);
return repo.getPackage();
} | class class_name[name] begin[{]
method[fromPackageRepository, return_type[type[RepositoryPackage]], modifier[public static], parameter[input]] begin[{]
local_variable[type[PackageRepository], repo]
return[call[repo.getPackage, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[RepositoryPackage] identifier[fromPackageRepository] operator[SEP] identifier[File] identifier[input] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ParseException] {
identifier[PackageRepository] identifier[repo] operator[=] Keyword[new] identifier[PackageRepository] operator[SEP] identifier[input] operator[SEP] operator[SEP] Keyword[return] identifier[repo] operator[SEP] identifier[getPackage] operator[SEP] operator[SEP] operator[SEP]
}
|
public void animateProgress(List<Boolean> circlePieceFillList, int duration) {
mCirclePieceFillList = circlePieceFillList;
AnimatorSet set = new AnimatorSet();
set.playTogether(Glider.glide(Skill.QuadEaseInOut, duration, ObjectAnimator.ofFloat(this, "progress", 0, 100)));
set.setDuration(duration);
set = addListenersToSet(set);
set.start();
} | class class_name[name] begin[{]
method[animateProgress, return_type[void], modifier[public], parameter[circlePieceFillList, duration]] begin[{]
assign[member[.mCirclePieceFillList], member[.circlePieceFillList]]
local_variable[type[AnimatorSet], set]
call[set.playTogether, parameter[call[Glider.glide, parameter[member[Skill.QuadEaseInOut], member[.duration], call[ObjectAnimator.ofFloat, parameter[THIS[], literal["progress"], literal[0], literal[100]]]]]]]
call[set.setDuration, parameter[member[.duration]]]
assign[member[.set], call[.addListenersToSet, parameter[member[.set]]]]
call[set.start, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[animateProgress] operator[SEP] identifier[List] operator[<] identifier[Boolean] operator[>] identifier[circlePieceFillList] , Keyword[int] identifier[duration] operator[SEP] {
identifier[mCirclePieceFillList] operator[=] identifier[circlePieceFillList] operator[SEP] identifier[AnimatorSet] identifier[set] operator[=] Keyword[new] identifier[AnimatorSet] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[playTogether] operator[SEP] identifier[Glider] operator[SEP] identifier[glide] operator[SEP] identifier[Skill] operator[SEP] identifier[QuadEaseInOut] , identifier[duration] , identifier[ObjectAnimator] operator[SEP] identifier[ofFloat] operator[SEP] Keyword[this] , literal[String] , Other[0] , Other[100] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[setDuration] operator[SEP] identifier[duration] operator[SEP] operator[SEP] identifier[set] operator[=] identifier[addListenersToSet] operator[SEP] identifier[set] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
|
public static byte[] readBytesAndClose(InputStream ins) {
byte[] bytes = null;
try {
bytes = readBytes(ins);
}
catch (IOException e) {
throw Lang.wrapThrow(e);
}
finally {
Streams.safeClose(ins);
}
return bytes;
} | class class_name[name] begin[{]
method[readBytesAndClose, return_type[type[byte]], modifier[public static], parameter[ins]] begin[{]
local_variable[type[byte], bytes]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ins, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrapThrow, postfix_operators=[], prefix_operators=[], qualifier=Lang, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ins, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=safeClose, postfix_operators=[], prefix_operators=[], qualifier=Streams, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
return[member[.bytes]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[readBytesAndClose] operator[SEP] identifier[InputStream] identifier[ins] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[bytes] operator[=] identifier[readBytes] operator[SEP] identifier[ins] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] identifier[Lang] operator[SEP] identifier[wrapThrow] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[Streams] operator[SEP] identifier[safeClose] operator[SEP] identifier[ins] operator[SEP] operator[SEP]
}
Keyword[return] identifier[bytes] operator[SEP]
}
|
public static String caculatorDateToString(Date date) {
long milliSecond = compareDate(date);
List dateCaculators = DateCalculator.getDateCalculators();
for (Iterator iterator = dateCaculators.iterator(); iterator.hasNext(); ) {
DateCalculator dateCalculator = (DateCalculator) iterator.next();
if (milliSecond >= dateCalculator.getMinMilliSecond()
&& milliSecond <= dateCalculator.getMaxMilliSecond()) {
String displayStr = dateCalculator.getDisplayStr();
long numberOfUnit = 0;
if (dateCalculator.getMinMilliSecond() == 0) { // 分母为零,则直接为0
numberOfUnit = 0;
} else {
numberOfUnit = milliSecond / dateCalculator.getMinMilliSecond();
}
// 替代所有{0}
Pattern p = Pattern.compile("(\\{.+?\\})");
Matcher m = p.matcher(displayStr);
displayStr = m.replaceAll(numberOfUnit + "");
// displayStr = displayStr.replace("\\{0\\}", numberOfUnit +
// "");
return displayStr;
}
}
return milliSecond + "";
} | class class_name[name] begin[{]
method[caculatorDateToString, return_type[type[String]], modifier[public static], parameter[date]] begin[{]
local_variable[type[long], milliSecond]
local_variable[type[List], dateCaculators]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DateCalculator, sub_type=None)), name=dateCalculator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DateCalculator, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=milliSecond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMinMilliSecond, postfix_operators=[], prefix_operators=[], qualifier=dateCalculator, selectors=[], type_arguments=None), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=milliSecond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMaxMilliSecond, postfix_operators=[], prefix_operators=[], qualifier=dateCalculator, selectors=[], type_arguments=None), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDisplayStr, postfix_operators=[], prefix_operators=[], qualifier=dateCalculator, selectors=[], type_arguments=None), name=displayStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=numberOfUnit)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMinMilliSecond, postfix_operators=[], prefix_operators=[], qualifier=dateCalculator, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=numberOfUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=milliSecond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMinMilliSecond, postfix_operators=[], prefix_operators=[], qualifier=dateCalculator, selectors=[], type_arguments=None), operator=/)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=numberOfUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(\\{.+?\\})")], member=compile, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None), name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pattern, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=displayStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=displayStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=numberOfUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operator=+)], member=replaceAll, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=MemberReference(member=displayStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=dateCaculators, selectors=[], type_arguments=None), name=iterator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
return[binary_operation[member[.milliSecond], +, literal[""]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[caculatorDateToString] operator[SEP] identifier[Date] identifier[date] operator[SEP] {
Keyword[long] identifier[milliSecond] operator[=] identifier[compareDate] operator[SEP] identifier[date] operator[SEP] operator[SEP] identifier[List] identifier[dateCaculators] operator[=] identifier[DateCalculator] operator[SEP] identifier[getDateCalculators] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] identifier[iterator] operator[=] identifier[dateCaculators] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[DateCalculator] identifier[dateCalculator] operator[=] operator[SEP] identifier[DateCalculator] operator[SEP] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[milliSecond] operator[>=] identifier[dateCalculator] operator[SEP] identifier[getMinMilliSecond] operator[SEP] operator[SEP] operator[&&] identifier[milliSecond] operator[<=] identifier[dateCalculator] operator[SEP] identifier[getMaxMilliSecond] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[displayStr] operator[=] identifier[dateCalculator] operator[SEP] identifier[getDisplayStr] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[numberOfUnit] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[dateCalculator] operator[SEP] identifier[getMinMilliSecond] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[numberOfUnit] operator[=] Other[0] operator[SEP]
}
Keyword[else] {
identifier[numberOfUnit] operator[=] identifier[milliSecond] operator[/] identifier[dateCalculator] operator[SEP] identifier[getMinMilliSecond] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Pattern] identifier[p] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Matcher] identifier[m] operator[=] identifier[p] operator[SEP] identifier[matcher] operator[SEP] identifier[displayStr] operator[SEP] operator[SEP] identifier[displayStr] operator[=] identifier[m] operator[SEP] identifier[replaceAll] operator[SEP] identifier[numberOfUnit] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[displayStr] operator[SEP]
}
}
Keyword[return] identifier[milliSecond] operator[+] literal[String] operator[SEP]
}
|
public <T extends OmiseObject> T deserializeFromMap(Map<String, Object> map, TypeReference<T> ref) {
return objectMapper.convertValue(map, ref);
} | class class_name[name] begin[{]
method[deserializeFromMap, return_type[type[T]], modifier[public], parameter[map, ref]] begin[{]
return[call[objectMapper.convertValue, parameter[member[.map], member[.ref]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[OmiseObject] operator[>] identifier[T] identifier[deserializeFromMap] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[map] , identifier[TypeReference] operator[<] identifier[T] operator[>] identifier[ref] operator[SEP] {
Keyword[return] identifier[objectMapper] operator[SEP] identifier[convertValue] operator[SEP] identifier[map] , identifier[ref] operator[SEP] operator[SEP]
}
|
public HttpMessage queryParams(final String queryParamString) {
header(HttpMessageHeaders.HTTP_QUERY_PARAMS, queryParamString);
header(DynamicEndpointUriResolver.QUERY_PARAM_HEADER_NAME, queryParamString);
Stream.of(queryParamString.split(","))
.map(keyValue -> Optional.ofNullable(StringUtils.split(keyValue, "=")).orElse(new String[]{keyValue, ""}))
.filter(keyValue -> StringUtils.hasText(keyValue[0]))
.forEach(keyValue -> this.addQueryParam(keyValue[0], keyValue[1]));
return this;
} | class class_name[name] begin[{]
method[queryParams, return_type[type[HttpMessage]], modifier[public], parameter[queryParamString]] begin[{]
call[.header, parameter[member[HttpMessageHeaders.HTTP_QUERY_PARAMS], member[.queryParamString]]]
call[.header, parameter[member[DynamicEndpointUriResolver.QUERY_PARAM_HEADER_NAME], member[.queryParamString]]]
call[Stream.of, parameter[call[queryParamString.split, parameter[literal[","]]]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[HttpMessage] identifier[queryParams] operator[SEP] Keyword[final] identifier[String] identifier[queryParamString] operator[SEP] {
identifier[header] operator[SEP] identifier[HttpMessageHeaders] operator[SEP] identifier[HTTP_QUERY_PARAMS] , identifier[queryParamString] operator[SEP] operator[SEP] identifier[header] operator[SEP] identifier[DynamicEndpointUriResolver] operator[SEP] identifier[QUERY_PARAM_HEADER_NAME] , identifier[queryParamString] operator[SEP] operator[SEP] identifier[Stream] operator[SEP] identifier[of] operator[SEP] identifier[queryParamString] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[keyValue] operator[->] identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[StringUtils] operator[SEP] identifier[split] operator[SEP] identifier[keyValue] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[keyValue] , literal[String]
} operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[keyValue] operator[->] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[keyValue] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[keyValue] operator[->] Keyword[this] operator[SEP] identifier[addQueryParam] operator[SEP] identifier[keyValue] operator[SEP] Other[0] operator[SEP] , identifier[keyValue] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public final CharSequence getError() {
if (leftMessage.getVisibility() == View.VISIBLE && (Boolean) leftMessage.getTag()) {
return leftMessage.getText();
}
return null;
} | class class_name[name] begin[{]
method[getError, return_type[type[CharSequence]], modifier[final public], parameter[]] begin[{]
if[binary_operation[binary_operation[call[leftMessage.getVisibility, parameter[]], ==, member[View.VISIBLE]], &&, Cast(expression=MethodInvocation(arguments=[], member=getTag, postfix_operators=[], prefix_operators=[], qualifier=leftMessage, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))]] begin[{]
return[call[leftMessage.getText, parameter[]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[CharSequence] identifier[getError] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[leftMessage] operator[SEP] identifier[getVisibility] operator[SEP] operator[SEP] operator[==] identifier[View] operator[SEP] identifier[VISIBLE] operator[&&] operator[SEP] identifier[Boolean] operator[SEP] identifier[leftMessage] operator[SEP] identifier[getTag] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[leftMessage] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public void init(CmsImagePreviewHandler handler) {
m_handler = handler;
m_propertiesTab = new CmsPropertiesTab(m_galleryMode, m_dialogHeight, m_dialogWidth, m_handler);
m_tabbedPanel.add(m_propertiesTab, Messages.get().key(Messages.GUI_PREVIEW_TAB_PROPERTIES_0));
if ((m_galleryMode == GalleryMode.editor) || (m_galleryMode == GalleryMode.widget)) {
m_imageFormatTab = new CmsImageFormatsTab(m_galleryMode, m_dialogHeight, m_dialogWidth, handler, null);
m_tabbedPanel.add(m_imageFormatTab, Messages.get().key(Messages.GUI_PREVIEW_TAB_IMAGEFORMAT_0));
}
if (getGalleryMode() == GalleryMode.editor) {
m_imageEditorFormatsTab = new CmsImageEditorTab(m_galleryMode, m_dialogHeight, m_dialogWidth, handler);
String hideFormatsParam = Window.Location.getParameter("hideformats");
boolean hideFormats = "true".equals(hideFormatsParam);
if (!hideFormats) {
m_tabbedPanel.add(m_imageEditorFormatsTab, Messages.get().key(Messages.GUI_PREVIEW_TAB_IMAGEOPTIONS_0));
}
m_imageAdvancedTab = new CmsImageAdvancedTab(m_galleryMode, m_dialogHeight, m_dialogWidth, handler);
if (!hideFormats) {
m_tabbedPanel.add(m_imageAdvancedTab, Messages.get().key(Messages.GUI_PREVIEW_TAB_IMAGEADVANCED_0));
}
}
m_tabbedPanel.addSelectionHandler(new SelectionHandler<Integer>() {
public void onSelection(SelectionEvent<Integer> event) {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@SuppressWarnings("synthetic-access")
public void execute() {
updateClassForTab(event.getSelectedItem().intValue());
}
});
}
});
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[public], parameter[handler]] begin[{]
assign[member[.m_handler], member[.handler]]
assign[member[.m_propertiesTab], ClassCreator(arguments=[MemberReference(member=m_galleryMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_dialogHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_dialogWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_handler, 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=CmsPropertiesTab, sub_type=None))]
call[m_tabbedPanel.add, parameter[member[.m_propertiesTab], call[Messages.get, parameter[]]]]
if[binary_operation[binary_operation[member[.m_galleryMode], ==, member[GalleryMode.editor]], ||, binary_operation[member[.m_galleryMode], ==, member[GalleryMode.widget]]]] begin[{]
assign[member[.m_imageFormatTab], ClassCreator(arguments=[MemberReference(member=m_galleryMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_dialogHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_dialogWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsImageFormatsTab, sub_type=None))]
call[m_tabbedPanel.add, parameter[member[.m_imageFormatTab], call[Messages.get, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[call[.getGalleryMode, parameter[]], ==, member[GalleryMode.editor]]] begin[{]
assign[member[.m_imageEditorFormatsTab], ClassCreator(arguments=[MemberReference(member=m_galleryMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_dialogHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_dialogWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handler, 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=CmsImageEditorTab, sub_type=None))]
local_variable[type[String], hideFormatsParam]
local_variable[type[boolean], hideFormats]
if[member[.hideFormats]] begin[{]
call[m_tabbedPanel.add, parameter[member[.m_imageEditorFormatsTab], call[Messages.get, parameter[]]]]
else begin[{]
None
end[}]
assign[member[.m_imageAdvancedTab], ClassCreator(arguments=[MemberReference(member=m_galleryMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_dialogHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_dialogWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handler, 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=CmsImageAdvancedTab, sub_type=None))]
if[member[.hideFormats]] begin[{]
call[m_tabbedPanel.add, parameter[member[.m_imageAdvancedTab], call[Messages.get, parameter[]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[m_tabbedPanel.addSelectionHandler, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Scheduler, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="synthetic-access"), name=SuppressWarnings)], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSelectedItem, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[MethodInvocation(arguments=[], member=intValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=updateClassForTab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, 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=ScheduledCommand, sub_type=None))], member=scheduleDeferred, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSelection, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=SelectionEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=SelectionHandler, sub_type=None))]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[CmsImagePreviewHandler] identifier[handler] operator[SEP] {
identifier[m_handler] operator[=] identifier[handler] operator[SEP] identifier[m_propertiesTab] operator[=] Keyword[new] identifier[CmsPropertiesTab] operator[SEP] identifier[m_galleryMode] , identifier[m_dialogHeight] , identifier[m_dialogWidth] , identifier[m_handler] operator[SEP] operator[SEP] identifier[m_tabbedPanel] operator[SEP] identifier[add] operator[SEP] identifier[m_propertiesTab] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_PREVIEW_TAB_PROPERTIES_0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[m_galleryMode] operator[==] identifier[GalleryMode] operator[SEP] identifier[editor] operator[SEP] operator[||] operator[SEP] identifier[m_galleryMode] operator[==] identifier[GalleryMode] operator[SEP] identifier[widget] operator[SEP] operator[SEP] {
identifier[m_imageFormatTab] operator[=] Keyword[new] identifier[CmsImageFormatsTab] operator[SEP] identifier[m_galleryMode] , identifier[m_dialogHeight] , identifier[m_dialogWidth] , identifier[handler] , Other[null] operator[SEP] operator[SEP] identifier[m_tabbedPanel] operator[SEP] identifier[add] operator[SEP] identifier[m_imageFormatTab] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_PREVIEW_TAB_IMAGEFORMAT_0] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[getGalleryMode] operator[SEP] operator[SEP] operator[==] identifier[GalleryMode] operator[SEP] identifier[editor] operator[SEP] {
identifier[m_imageEditorFormatsTab] operator[=] Keyword[new] identifier[CmsImageEditorTab] operator[SEP] identifier[m_galleryMode] , identifier[m_dialogHeight] , identifier[m_dialogWidth] , identifier[handler] operator[SEP] operator[SEP] identifier[String] identifier[hideFormatsParam] operator[=] identifier[Window] operator[SEP] identifier[Location] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[hideFormats] operator[=] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[hideFormatsParam] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[hideFormats] operator[SEP] {
identifier[m_tabbedPanel] operator[SEP] identifier[add] operator[SEP] identifier[m_imageEditorFormatsTab] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_PREVIEW_TAB_IMAGEOPTIONS_0] operator[SEP] operator[SEP] operator[SEP]
}
identifier[m_imageAdvancedTab] operator[=] Keyword[new] identifier[CmsImageAdvancedTab] operator[SEP] identifier[m_galleryMode] , identifier[m_dialogHeight] , identifier[m_dialogWidth] , identifier[handler] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[hideFormats] operator[SEP] {
identifier[m_tabbedPanel] operator[SEP] identifier[add] operator[SEP] identifier[m_imageAdvancedTab] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_PREVIEW_TAB_IMAGEADVANCED_0] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[m_tabbedPanel] operator[SEP] identifier[addSelectionHandler] operator[SEP] Keyword[new] identifier[SelectionHandler] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onSelection] operator[SEP] identifier[SelectionEvent] operator[<] identifier[Integer] operator[>] identifier[event] operator[SEP] {
identifier[Scheduler] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[scheduleDeferred] operator[SEP] Keyword[new] identifier[ScheduledCommand] operator[SEP] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] {
identifier[updateClassForTab] operator[SEP] identifier[event] operator[SEP] identifier[getSelectedItem] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public int indexOf(int hashCode) {
int pos=binarySearchHashCode(hashCode);
if(pos<0) return -1;
// Try backwards until different hashCode
while(pos>0 && get(pos-1).hashCode()==hashCode) pos--;
return pos;
} | class class_name[name] begin[{]
method[indexOf, return_type[type[int]], modifier[public], parameter[hashCode]] begin[{]
local_variable[type[int], pos]
if[binary_operation[member[.pos], <, literal[0]]] begin[{]
return[literal[1]]
else begin[{]
None
end[}]
while[binary_operation[binary_operation[member[.pos], >, literal[0]], &&, binary_operation[call[.get, parameter[binary_operation[member[.pos], -, literal[1]]]], ==, member[.hashCode]]]] begin[{]
member[.pos]
end[}]
return[member[.pos]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[indexOf] operator[SEP] Keyword[int] identifier[hashCode] operator[SEP] {
Keyword[int] identifier[pos] operator[=] identifier[binarySearchHashCode] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[<] Other[0] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[pos] operator[>] Other[0] operator[&&] identifier[get] operator[SEP] identifier[pos] operator[-] Other[1] operator[SEP] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[==] identifier[hashCode] operator[SEP] identifier[pos] operator[--] operator[SEP] Keyword[return] identifier[pos] operator[SEP]
}
|
public static int start(Media levelrip, MapTile map, ProgressListener listener)
{
return start(levelrip, map, listener, null);
} | class class_name[name] begin[{]
method[start, return_type[type[int]], modifier[public static], parameter[levelrip, map, listener]] begin[{]
return[call[.start, parameter[member[.levelrip], member[.map], member[.listener], literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[start] operator[SEP] identifier[Media] identifier[levelrip] , identifier[MapTile] identifier[map] , identifier[ProgressListener] identifier[listener] operator[SEP] {
Keyword[return] identifier[start] operator[SEP] identifier[levelrip] , identifier[map] , identifier[listener] , Other[null] operator[SEP] operator[SEP]
}
|
private String encode(String str) {
if (str == null) {
return null;
}
try {
return URLEncoder.encode(str, Charsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
// Should never happen
throw Throwables.propagate(e);
}
} | class class_name[name] begin[{]
method[encode, return_type[type[String]], modifier[private], parameter[str]] begin[{]
if[binary_operation[member[.str], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=Charsets.UTF_8, selectors=[], type_arguments=None)], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=propagate, postfix_operators=[], prefix_operators=[], qualifier=Throwables, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] identifier[String] identifier[encode] operator[SEP] identifier[String] identifier[str] operator[SEP] {
Keyword[if] operator[SEP] identifier[str] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[try] {
Keyword[return] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[str] , identifier[Charsets] operator[SEP] identifier[UTF_8] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] {
Keyword[throw] identifier[Throwables] operator[SEP] identifier[propagate] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public String pageHtml(int segment, boolean loadStyles) {
if (useNewStyle()) {
return super.pageHtml(segment, null, getParamTitle());
}
if (segment == HTML_START) {
StringBuffer result = new StringBuffer(512);
result.append("<!DOCTYPE html>\n");
result.append("<html>\n<head>\n");
result.append("<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=");
result.append(getEncoding());
result.append("\">\n");
if (loadStyles) {
result.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
result.append(getStyleUri(getJsp(), "workplace.css"));
result.append("\">\n");
result.append("<script type=\"text/javascript\">\n");
result.append(dialogScriptSubmit());
result.append("</script>\n");
}
return result.toString();
} else {
return "</html>";
}
} | class class_name[name] begin[{]
method[pageHtml, return_type[type[String]], modifier[public], parameter[segment, loadStyles]] begin[{]
if[call[.useNewStyle, parameter[]]] begin[{]
return[SuperMethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=getParamTitle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=pageHtml, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
else begin[{]
None
end[}]
if[binary_operation[member[.segment], ==, member[.HTML_START]]] begin[{]
local_variable[type[StringBuffer], result]
call[result.append, parameter[literal["<!DOCTYPE html>\n"]]]
call[result.append, parameter[literal["<html>\n<head>\n"]]]
call[result.append, parameter[literal["<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset="]]]
call[result.append, parameter[call[.getEncoding, parameter[]]]]
call[result.append, parameter[literal["\">\n"]]]
if[member[.loadStyles]] begin[{]
call[result.append, parameter[literal["<link rel=\"stylesheet\" type=\"text/css\" href=\""]]]
call[result.append, parameter[call[.getStyleUri, parameter[call[.getJsp, parameter[]], literal["workplace.css"]]]]]
call[result.append, parameter[literal["\">\n"]]]
call[result.append, parameter[literal["<script type=\"text/javascript\">\n"]]]
call[result.append, parameter[call[.dialogScriptSubmit, parameter[]]]]
call[result.append, parameter[literal["</script>\n"]]]
else begin[{]
None
end[}]
return[call[result.toString, parameter[]]]
else begin[{]
return[literal["</html>"]]
end[}]
end[}]
END[}] | Keyword[public] identifier[String] identifier[pageHtml] operator[SEP] Keyword[int] identifier[segment] , Keyword[boolean] identifier[loadStyles] operator[SEP] {
Keyword[if] operator[SEP] identifier[useNewStyle] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Keyword[super] operator[SEP] identifier[pageHtml] operator[SEP] identifier[segment] , Other[null] , identifier[getParamTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[segment] operator[==] identifier[HTML_START] operator[SEP] {
identifier[StringBuffer] identifier[result] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[512] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[getEncoding] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[loadStyles] operator[SEP] {
identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[getStyleUri] operator[SEP] identifier[getJsp] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[dialogScriptSubmit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] literal[String] operator[SEP]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.