code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName) {
return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body();
} | class class_name[name] begin[{]
method[beginBackendHealth, return_type[type[ApplicationGatewayBackendHealthInner]], modifier[public], parameter[resourceGroupName, applicationGatewayName]] begin[{]
return[call[.beginBackendHealthWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.applicationGatewayName]]]]
end[}]
END[}] | Keyword[public] identifier[ApplicationGatewayBackendHealthInner] identifier[beginBackendHealth] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[applicationGatewayName] operator[SEP] {
Keyword[return] identifier[beginBackendHealthWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[applicationGatewayName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
static String getORBgiopMaxMsgSize()
{
// Check if already done
if (orb_max_msg_size==null)
if ((orb_max_msg_size=System.getProperty("ORBgiopMaxMsgSize"))==null) // From JVM property
if ((orb_max_msg_size=System.getenv("ORBgiopMaxMsgSize"))==null) // From Environment property
orb_max_msg_size = getFromEnvFile("ORBgiopMaxMsgSize"); // From Environment file
// else
return orb_max_msg_size;
} | class class_name[name] begin[{]
method[getORBgiopMaxMsgSize, return_type[type[String]], modifier[static], parameter[]] begin[{]
if[binary_operation[member[.orb_max_msg_size], ==, literal[null]]] begin[{]
if[binary_operation[assign[member[.orb_max_msg_size], call[System.getProperty, parameter[literal["ORBgiopMaxMsgSize"]]]], ==, literal[null]]] begin[{]
if[binary_operation[assign[member[.orb_max_msg_size], call[System.getenv, parameter[literal["ORBgiopMaxMsgSize"]]]], ==, literal[null]]] begin[{]
assign[member[.orb_max_msg_size], call[.getFromEnvFile, parameter[literal["ORBgiopMaxMsgSize"]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.orb_max_msg_size]]
end[}]
END[}] | Keyword[static] identifier[String] identifier[getORBgiopMaxMsgSize] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[orb_max_msg_size] operator[==] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[orb_max_msg_size] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[orb_max_msg_size] operator[=] identifier[System] operator[SEP] identifier[getenv] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] identifier[orb_max_msg_size] operator[=] identifier[getFromEnvFile] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[orb_max_msg_size] operator[SEP]
}
|
public DependencyId[] getDependencyIds(){
DependencyId[] depIds = new DependencyId[configEntry.dependencyIds.length];
for ( int i=0; i<configEntry.dependencyIds.length; i++ ){
depIds[i] = new DependencyId(configEntry.dependencyIds[i]);
}
return depIds;
} | class class_name[name] begin[{]
method[getDependencyIds, return_type[type[DependencyId]], modifier[public], parameter[]] begin[{]
local_variable[type[DependencyId], depIds]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=depIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=dependencyIds, postfix_operators=[], prefix_operators=[], qualifier=configEntry, 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=DependencyId, sub_type=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=configEntry.dependencyIds, 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[.depIds]]
end[}]
END[}] | Keyword[public] identifier[DependencyId] operator[SEP] operator[SEP] identifier[getDependencyIds] operator[SEP] operator[SEP] {
identifier[DependencyId] operator[SEP] operator[SEP] identifier[depIds] operator[=] Keyword[new] identifier[DependencyId] operator[SEP] identifier[configEntry] operator[SEP] identifier[dependencyIds] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[configEntry] operator[SEP] identifier[dependencyIds] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[depIds] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[DependencyId] operator[SEP] identifier[configEntry] operator[SEP] identifier[dependencyIds] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[depIds] operator[SEP]
}
|
public HtmlResponse renderWith(RenderDataRegistration dataLambda) {
assertArgumentNotNull("dataLambda", dataLambda);
assertDefinedState("renderWith");
if (viewObject != null) {
String msg = "Cannot call renderWith() with withView(): viewObject=" + viewObject;
throw new IllegalStateException(msg);
}
if (registrationList == null) {
registrationList = new ArrayList<RenderDataRegistration>(4);
}
registrationList.add(dataLambda);
return this;
} | class class_name[name] begin[{]
method[renderWith, return_type[type[HtmlResponse]], modifier[public], parameter[dataLambda]] begin[{]
call[.assertArgumentNotNull, parameter[literal["dataLambda"], member[.dataLambda]]]
call[.assertDefinedState, parameter[literal["renderWith"]]]
if[binary_operation[member[.viewObject], !=, literal[null]]] begin[{]
local_variable[type[String], msg]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.registrationList], ==, literal[null]]] begin[{]
assign[member[.registrationList], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], 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=RenderDataRegistration, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
call[registrationList.add, parameter[member[.dataLambda]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[HtmlResponse] identifier[renderWith] operator[SEP] identifier[RenderDataRegistration] identifier[dataLambda] operator[SEP] {
identifier[assertArgumentNotNull] operator[SEP] literal[String] , identifier[dataLambda] operator[SEP] operator[SEP] identifier[assertDefinedState] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[viewObject] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[viewObject] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[msg] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[registrationList] operator[==] Other[null] operator[SEP] {
identifier[registrationList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[RenderDataRegistration] operator[>] operator[SEP] Other[4] operator[SEP] operator[SEP]
}
identifier[registrationList] operator[SEP] identifier[add] operator[SEP] identifier[dataLambda] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static PrimitiveMatrix toCorrelations(Access2D<?> covariances, boolean clean) {
int size = Math.toIntExact(Math.min(covariances.countRows(), covariances.countColumns()));
MatrixStore<Double> covarianceMtrx = MatrixStore.PRIMITIVE.makeWrapper(covariances).get();
if (clean) {
Eigenvalue<Double> evd = Eigenvalue.PRIMITIVE.make(covarianceMtrx, true);
evd.decompose(covarianceMtrx);
MatrixStore<Double> mtrxV = evd.getV();
PhysicalStore<Double> mtrxD = evd.getD().copy();
double largest = evd.getEigenvalues().get(0).norm();
double limit = largest * size * PrimitiveMath.RELATIVELY_SMALL;
for (int ij = 0; ij < size; ij++) {
if (mtrxD.doubleValue(ij, ij) < limit) {
mtrxD.set(ij, ij, limit);
}
}
covarianceMtrx = mtrxV.multiply(mtrxD).multiply(mtrxV.transpose());
}
PrimitiveMatrix.DenseReceiver retVal = PrimitiveMatrix.FACTORY.makeDense(size, size);
double[] volatilities = new double[size];
for (int ij = 0; ij < size; ij++) {
volatilities[ij] = PrimitiveMath.SQRT.invoke(covarianceMtrx.doubleValue(ij, ij));
}
for (int j = 0; j < size; j++) {
double colVol = volatilities[j];
retVal.set(j, j, PrimitiveMath.ONE);
for (int i = j + 1; i < size; i++) {
double rowVol = volatilities[i];
if ((rowVol <= PrimitiveMath.ZERO) || (colVol <= PrimitiveMath.ZERO)) {
retVal.set(i, j, PrimitiveMath.ZERO);
retVal.set(j, i, PrimitiveMath.ZERO);
} else {
double covariance = covarianceMtrx.doubleValue(i, j);
double correlation = covariance / (rowVol * colVol);
retVal.set(i, j, correlation);
retVal.set(j, i, correlation);
}
}
}
return retVal.get();
} | class class_name[name] begin[{]
method[toCorrelations, return_type[type[PrimitiveMatrix]], modifier[public static], parameter[covariances, clean]] begin[{]
local_variable[type[int], size]
local_variable[type[MatrixStore], covarianceMtrx]
if[member[.clean]] begin[{]
local_variable[type[Eigenvalue], evd]
call[evd.decompose, parameter[member[.covarianceMtrx]]]
local_variable[type[MatrixStore], mtrxV]
local_variable[type[PhysicalStore], mtrxD]
local_variable[type[double], largest]
local_variable[type[double], limit]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=mtrxD, selectors=[], type_arguments=None), operandr=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=mtrxD, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, 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=ij)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ij, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.covarianceMtrx], call[mtrxV.multiply, parameter[member[.mtrxD]]]]
else begin[{]
None
end[}]
local_variable[type[PrimitiveMatrix], retVal]
local_variable[type[double], volatilities]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=volatilities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=covarianceMtrx, selectors=[], type_arguments=None)], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=PrimitiveMath.SQRT, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, 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=ij)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ij, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=volatilities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=colVol)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ONE, postfix_operators=[], prefix_operators=[], qualifier=PrimitiveMath, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=retVal, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=volatilities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=rowVol)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rowVol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ZERO, postfix_operators=[], prefix_operators=[], qualifier=PrimitiveMath, selectors=[]), operator=<=), operandr=BinaryOperation(operandl=MemberReference(member=colVol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ZERO, postfix_operators=[], prefix_operators=[], qualifier=PrimitiveMath, selectors=[]), operator=<=), operator=||), else_statement=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=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=covarianceMtrx, selectors=[], type_arguments=None), name=covariance)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=covariance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=rowVol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=colVol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=/), name=correlation)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=correlation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=retVal, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=correlation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=retVal, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ZERO, postfix_operators=[], prefix_operators=[], qualifier=PrimitiveMath, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=retVal, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ZERO, postfix_operators=[], prefix_operators=[], qualifier=PrimitiveMath, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=retVal, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[retVal.get, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[PrimitiveMatrix] identifier[toCorrelations] operator[SEP] identifier[Access2D] operator[<] operator[?] operator[>] identifier[covariances] , Keyword[boolean] identifier[clean] operator[SEP] {
Keyword[int] identifier[size] operator[=] identifier[Math] operator[SEP] identifier[toIntExact] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[covariances] operator[SEP] identifier[countRows] operator[SEP] operator[SEP] , identifier[covariances] operator[SEP] identifier[countColumns] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[MatrixStore] operator[<] identifier[Double] operator[>] identifier[covarianceMtrx] operator[=] identifier[MatrixStore] operator[SEP] identifier[PRIMITIVE] operator[SEP] identifier[makeWrapper] operator[SEP] identifier[covariances] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clean] operator[SEP] {
identifier[Eigenvalue] operator[<] identifier[Double] operator[>] identifier[evd] operator[=] identifier[Eigenvalue] operator[SEP] identifier[PRIMITIVE] operator[SEP] identifier[make] operator[SEP] identifier[covarianceMtrx] , literal[boolean] operator[SEP] operator[SEP] identifier[evd] operator[SEP] identifier[decompose] operator[SEP] identifier[covarianceMtrx] operator[SEP] operator[SEP] identifier[MatrixStore] operator[<] identifier[Double] operator[>] identifier[mtrxV] operator[=] identifier[evd] operator[SEP] identifier[getV] operator[SEP] operator[SEP] operator[SEP] identifier[PhysicalStore] operator[<] identifier[Double] operator[>] identifier[mtrxD] operator[=] identifier[evd] operator[SEP] identifier[getD] operator[SEP] operator[SEP] operator[SEP] identifier[copy] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[largest] operator[=] identifier[evd] operator[SEP] identifier[getEigenvalues] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[norm] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[limit] operator[=] identifier[largest] operator[*] identifier[size] operator[*] identifier[PrimitiveMath] operator[SEP] identifier[RELATIVELY_SMALL] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ij] operator[=] Other[0] operator[SEP] identifier[ij] operator[<] identifier[size] operator[SEP] identifier[ij] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[mtrxD] operator[SEP] identifier[doubleValue] operator[SEP] identifier[ij] , identifier[ij] operator[SEP] operator[<] identifier[limit] operator[SEP] {
identifier[mtrxD] operator[SEP] identifier[set] operator[SEP] identifier[ij] , identifier[ij] , identifier[limit] operator[SEP] operator[SEP]
}
}
identifier[covarianceMtrx] operator[=] identifier[mtrxV] operator[SEP] identifier[multiply] operator[SEP] identifier[mtrxD] operator[SEP] operator[SEP] identifier[multiply] operator[SEP] identifier[mtrxV] operator[SEP] identifier[transpose] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[PrimitiveMatrix] operator[SEP] identifier[DenseReceiver] identifier[retVal] operator[=] identifier[PrimitiveMatrix] operator[SEP] identifier[FACTORY] operator[SEP] identifier[makeDense] operator[SEP] identifier[size] , identifier[size] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[volatilities] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ij] operator[=] Other[0] operator[SEP] identifier[ij] operator[<] identifier[size] operator[SEP] identifier[ij] operator[++] operator[SEP] {
identifier[volatilities] operator[SEP] identifier[ij] operator[SEP] operator[=] identifier[PrimitiveMath] operator[SEP] identifier[SQRT] operator[SEP] identifier[invoke] operator[SEP] identifier[covarianceMtrx] operator[SEP] identifier[doubleValue] operator[SEP] identifier[ij] , identifier[ij] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[size] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[double] identifier[colVol] operator[=] identifier[volatilities] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[retVal] operator[SEP] identifier[set] operator[SEP] identifier[j] , identifier[j] , identifier[PrimitiveMath] operator[SEP] identifier[ONE] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[j] operator[+] Other[1] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[double] identifier[rowVol] operator[=] identifier[volatilities] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[rowVol] operator[<=] identifier[PrimitiveMath] operator[SEP] identifier[ZERO] operator[SEP] operator[||] operator[SEP] identifier[colVol] operator[<=] identifier[PrimitiveMath] operator[SEP] identifier[ZERO] operator[SEP] operator[SEP] {
identifier[retVal] operator[SEP] identifier[set] operator[SEP] identifier[i] , identifier[j] , identifier[PrimitiveMath] operator[SEP] identifier[ZERO] operator[SEP] operator[SEP] identifier[retVal] operator[SEP] identifier[set] operator[SEP] identifier[j] , identifier[i] , identifier[PrimitiveMath] operator[SEP] identifier[ZERO] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[double] identifier[covariance] operator[=] identifier[covarianceMtrx] operator[SEP] identifier[doubleValue] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[correlation] operator[=] identifier[covariance] operator[/] operator[SEP] identifier[rowVol] operator[*] identifier[colVol] operator[SEP] operator[SEP] identifier[retVal] operator[SEP] identifier[set] operator[SEP] identifier[i] , identifier[j] , identifier[correlation] operator[SEP] operator[SEP] identifier[retVal] operator[SEP] identifier[set] operator[SEP] identifier[j] , identifier[i] , identifier[correlation] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[retVal] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
|
@PostMapping(
value = "/{entityTypeId}/meta",
params = "_method=GET",
produces = APPLICATION_JSON_VALUE)
public EntityTypeResponse retrieveEntityTypePost(
@PathVariable("entityTypeId") String entityTypeId,
@Valid @RequestBody EntityTypeRequest request) {
Set<String> attributesSet = toAttributeSet(request != null ? request.getAttributes() : null);
Map<String, Set<String>> attributeExpandSet =
toExpandMap(request != null ? request.getExpand() : null);
EntityType meta = dataService.getEntityType(entityTypeId);
return new EntityTypeResponse(
meta, attributesSet, attributeExpandSet, permissionService, dataService);
} | class class_name[name] begin[{]
method[retrieveEntityTypePost, return_type[type[EntityTypeResponse]], modifier[public], parameter[entityTypeId, request]] begin[{]
local_variable[type[Set], attributesSet]
local_variable[type[Map], attributeExpandSet]
local_variable[type[EntityType], meta]
return[ClassCreator(arguments=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributesSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributeExpandSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=permissionService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataService, 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=EntityTypeResponse, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[PostMapping] operator[SEP] identifier[value] operator[=] literal[String] , identifier[params] operator[=] literal[String] , identifier[produces] operator[=] identifier[APPLICATION_JSON_VALUE] operator[SEP] Keyword[public] identifier[EntityTypeResponse] identifier[retrieveEntityTypePost] operator[SEP] annotation[@] identifier[PathVariable] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[entityTypeId] , annotation[@] identifier[Valid] annotation[@] identifier[RequestBody] identifier[EntityTypeRequest] identifier[request] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[attributesSet] operator[=] identifier[toAttributeSet] operator[SEP] identifier[request] operator[!=] Other[null] operator[?] identifier[request] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[attributeExpandSet] operator[=] identifier[toExpandMap] operator[SEP] identifier[request] operator[!=] Other[null] operator[?] identifier[request] operator[SEP] identifier[getExpand] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] operator[SEP] identifier[EntityType] identifier[meta] operator[=] identifier[dataService] operator[SEP] identifier[getEntityType] operator[SEP] identifier[entityTypeId] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[EntityTypeResponse] operator[SEP] identifier[meta] , identifier[attributesSet] , identifier[attributeExpandSet] , identifier[permissionService] , identifier[dataService] operator[SEP] operator[SEP]
}
|
public String getParentCursor(String columnListParamName) {
FunctionParamInfo funcParamInfo = functionCallStack.peek();
Map<String, String> parentCursorMap =
funcParamInfo.columnListParamToParentCursorMap;
return parentCursorMap.get(columnListParamName);
} | class class_name[name] begin[{]
method[getParentCursor, return_type[type[String]], modifier[public], parameter[columnListParamName]] begin[{]
local_variable[type[FunctionParamInfo], funcParamInfo]
local_variable[type[Map], parentCursorMap]
return[call[parentCursorMap.get, parameter[member[.columnListParamName]]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getParentCursor] operator[SEP] identifier[String] identifier[columnListParamName] operator[SEP] {
identifier[FunctionParamInfo] identifier[funcParamInfo] operator[=] identifier[functionCallStack] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parentCursorMap] operator[=] identifier[funcParamInfo] operator[SEP] identifier[columnListParamToParentCursorMap] operator[SEP] Keyword[return] identifier[parentCursorMap] operator[SEP] identifier[get] operator[SEP] identifier[columnListParamName] operator[SEP] operator[SEP]
}
|
public static Location getLocation(Object obj, String description) {
if (obj instanceof Location) {
return (Location) obj;
}
if (obj instanceof Locatable) {
return ((Locatable) obj).getLocation();
}
if (obj instanceof SAXParseException) {
SAXParseException spe = (SAXParseException) obj;
if (spe.getSystemId() != null) {
return new LocationImpl(description, spe.getSystemId(), spe.getLineNumber(), spe.getColumnNumber());
} else {
return LocationImpl.UNKNOWN;
}
}
if (obj instanceof TransformerException) {
TransformerException ex = (TransformerException) obj;
SourceLocator locator = ex.getLocator();
if (locator != null && locator.getSystemId() != null) {
return new LocationImpl(description, locator.getSystemId(), locator.getLineNumber(),
locator.getColumnNumber());
} else {
return LocationImpl.UNKNOWN;
}
}
if (obj instanceof Locator) {
Locator locator = (Locator) obj;
if (locator.getSystemId() != null) {
return new LocationImpl(description, locator.getSystemId(), locator.getLineNumber(),
locator.getColumnNumber());
} else {
return LocationImpl.UNKNOWN;
}
}
if (obj instanceof Element) {
return LocationAttributes.getLocation((Element) obj);
}
List<WeakReference<LocationFinder>> currentFinders = finders;
int size = currentFinders.size();
for (int i = 0; i < size; i++) {
WeakReference<LocationFinder> ref = currentFinders.get(i);
LocationFinder finder = ref.get();
if (finder == null) {
synchronized (LocationFinder.class) {
List<WeakReference<LocationFinder>> newFinders = new ArrayList<WeakReference<LocationFinder>>(
finders);
newFinders.remove(ref);
finders = newFinders;
}
}
Location result = finder.getLocation(obj, description);
if (result != null) {
return result;
}
}
if (obj instanceof Throwable) {
Throwable t = (Throwable) obj;
StackTraceElement[] stack = t.getStackTrace();
if (stack != null && stack.length > 0) {
StackTraceElement trace = stack[0];
if (trace.getLineNumber() >= 0) {
String uri = trace.getClassName();
if (trace.getFileName() != null) {
uri = uri.replace('.', '/');
uri = uri.substring(0, uri.lastIndexOf('/') + 1);
uri = uri + trace.getFileName();
URL url = ClassLoaderUtil.getResource(uri, LocationUtils.class);
if (url != null) {
uri = url.toString();
}
}
if (description == null) {
StringBuilder sb = new StringBuilder();
sb.append("Class: ").append(trace.getClassName()).append("\n");
sb.append("File: ").append(trace.getFileName()).append("\n");
sb.append("Method: ").append(trace.getMethodName()).append("\n");
sb.append("Line: ").append(trace.getLineNumber());
description = sb.toString();
}
return new LocationImpl(description, uri, trace.getLineNumber(), -1);
}
}
}
return LocationImpl.UNKNOWN;
} | class class_name[name] begin[{]
method[getLocation, return_type[type[Location]], modifier[public static], parameter[obj, description]] begin[{]
if[binary_operation[member[.obj], instanceof, type[Location]]] begin[{]
return[Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Location, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.obj], instanceof, type[Locatable]]] begin[{]
return[Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Locatable, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.obj], instanceof, type[SAXParseException]]] begin[{]
local_variable[type[SAXParseException], spe]
if[binary_operation[call[spe.getSystemId, parameter[]], !=, literal[null]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSystemId, postfix_operators=[], prefix_operators=[], qualifier=spe, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLineNumber, postfix_operators=[], prefix_operators=[], qualifier=spe, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getColumnNumber, postfix_operators=[], prefix_operators=[], qualifier=spe, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LocationImpl, sub_type=None))]
else begin[{]
return[member[LocationImpl.UNKNOWN]]
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.obj], instanceof, type[TransformerException]]] begin[{]
local_variable[type[TransformerException], ex]
local_variable[type[SourceLocator], locator]
if[binary_operation[binary_operation[member[.locator], !=, literal[null]], &&, binary_operation[call[locator.getSystemId, parameter[]], !=, literal[null]]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSystemId, postfix_operators=[], prefix_operators=[], qualifier=locator, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLineNumber, postfix_operators=[], prefix_operators=[], qualifier=locator, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getColumnNumber, postfix_operators=[], prefix_operators=[], qualifier=locator, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LocationImpl, sub_type=None))]
else begin[{]
return[member[LocationImpl.UNKNOWN]]
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.obj], instanceof, type[Locator]]] begin[{]
local_variable[type[Locator], locator]
if[binary_operation[call[locator.getSystemId, parameter[]], !=, literal[null]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSystemId, postfix_operators=[], prefix_operators=[], qualifier=locator, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLineNumber, postfix_operators=[], prefix_operators=[], qualifier=locator, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getColumnNumber, postfix_operators=[], prefix_operators=[], qualifier=locator, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LocationImpl, sub_type=None))]
else begin[{]
return[member[LocationImpl.UNKNOWN]]
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.obj], instanceof, type[Element]]] begin[{]
return[call[LocationAttributes.getLocation, parameter[Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))]]]
else begin[{]
None
end[}]
local_variable[type[List], currentFinders]
local_variable[type[int], size]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=currentFinders, selectors=[], type_arguments=None), name=ref)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=LocationFinder, sub_type=None))], dimensions=[], name=WeakReference, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=ref, selectors=[], type_arguments=None), name=finder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LocationFinder, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=finder, 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=[SynchronizedStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=finders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=LocationFinder, sub_type=None))], dimensions=[], name=WeakReference, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=newFinders)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=LocationFinder, sub_type=None))], dimensions=[], name=WeakReference, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=newFinders, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=finders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=newFinders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, lock=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LocationFinder, sub_type=None)))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLocation, postfix_operators=[], prefix_operators=[], qualifier=finder, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Location, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=result, 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=size, 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)
if[binary_operation[member[.obj], instanceof, type[Throwable]]] begin[{]
local_variable[type[Throwable], t]
local_variable[type[StackTraceElement], stack]
if[binary_operation[binary_operation[member[.stack], !=, literal[null]], &&, binary_operation[member[stack.length], >, literal[0]]]] begin[{]
local_variable[type[StackTraceElement], trace]
if[binary_operation[call[trace.getLineNumber, parameter[]], >=, literal[0]]] begin[{]
local_variable[type[String], uri]
if[binary_operation[call[trace.getFileName, parameter[]], !=, literal[null]]] begin[{]
assign[member[.uri], call[uri.replace, parameter[literal['.'], literal['/']]]]
assign[member[.uri], call[uri.substring, parameter[literal[0], binary_operation[call[uri.lastIndexOf, parameter[literal['/']]], +, literal[1]]]]]
assign[member[.uri], binary_operation[member[.uri], +, call[trace.getFileName, parameter[]]]]
local_variable[type[URL], url]
if[binary_operation[member[.url], !=, literal[null]]] begin[{]
assign[member[.uri], call[url.toString, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.description], ==, literal[null]]] begin[{]
local_variable[type[StringBuilder], sb]
call[sb.append, parameter[literal["Class: "]]]
call[sb.append, parameter[literal["File: "]]]
call[sb.append, parameter[literal["Method: "]]]
call[sb.append, parameter[literal["Line: "]]]
assign[member[.description], call[sb.toString, parameter[]]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getLineNumber, postfix_operators=[], prefix_operators=[], qualifier=trace, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LocationImpl, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[LocationImpl.UNKNOWN]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Location] identifier[getLocation] operator[SEP] identifier[Object] identifier[obj] , identifier[String] identifier[description] operator[SEP] {
Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Location] operator[SEP] {
Keyword[return] operator[SEP] identifier[Location] operator[SEP] identifier[obj] operator[SEP]
}
Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Locatable] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[Locatable] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[SAXParseException] operator[SEP] {
identifier[SAXParseException] identifier[spe] operator[=] operator[SEP] identifier[SAXParseException] operator[SEP] identifier[obj] operator[SEP] Keyword[if] operator[SEP] identifier[spe] operator[SEP] identifier[getSystemId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[LocationImpl] operator[SEP] identifier[description] , identifier[spe] operator[SEP] identifier[getSystemId] operator[SEP] operator[SEP] , identifier[spe] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] , identifier[spe] operator[SEP] identifier[getColumnNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[LocationImpl] operator[SEP] identifier[UNKNOWN] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[TransformerException] operator[SEP] {
identifier[TransformerException] identifier[ex] operator[=] operator[SEP] identifier[TransformerException] operator[SEP] identifier[obj] operator[SEP] identifier[SourceLocator] identifier[locator] operator[=] identifier[ex] operator[SEP] identifier[getLocator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[locator] operator[!=] Other[null] operator[&&] identifier[locator] operator[SEP] identifier[getSystemId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[LocationImpl] operator[SEP] identifier[description] , identifier[locator] operator[SEP] identifier[getSystemId] operator[SEP] operator[SEP] , identifier[locator] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] , identifier[locator] operator[SEP] identifier[getColumnNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[LocationImpl] operator[SEP] identifier[UNKNOWN] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Locator] operator[SEP] {
identifier[Locator] identifier[locator] operator[=] operator[SEP] identifier[Locator] operator[SEP] identifier[obj] operator[SEP] Keyword[if] operator[SEP] identifier[locator] operator[SEP] identifier[getSystemId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[LocationImpl] operator[SEP] identifier[description] , identifier[locator] operator[SEP] identifier[getSystemId] operator[SEP] operator[SEP] , identifier[locator] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] , identifier[locator] operator[SEP] identifier[getColumnNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[LocationImpl] operator[SEP] identifier[UNKNOWN] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Element] operator[SEP] {
Keyword[return] identifier[LocationAttributes] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] identifier[Element] operator[SEP] identifier[obj] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[WeakReference] operator[<] identifier[LocationFinder] operator[>] operator[>] identifier[currentFinders] operator[=] identifier[finders] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[currentFinders] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[WeakReference] operator[<] identifier[LocationFinder] operator[>] identifier[ref] operator[=] identifier[currentFinders] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[LocationFinder] identifier[finder] operator[=] identifier[ref] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[finder] operator[==] Other[null] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[LocationFinder] operator[SEP] Keyword[class] operator[SEP] {
identifier[List] operator[<] identifier[WeakReference] operator[<] identifier[LocationFinder] operator[>] operator[>] identifier[newFinders] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[WeakReference] operator[<] identifier[LocationFinder] operator[>] operator[>] operator[SEP] identifier[finders] operator[SEP] operator[SEP] identifier[newFinders] operator[SEP] identifier[remove] operator[SEP] identifier[ref] operator[SEP] operator[SEP] identifier[finders] operator[=] identifier[newFinders] operator[SEP]
}
}
identifier[Location] identifier[result] operator[=] identifier[finder] operator[SEP] identifier[getLocation] operator[SEP] identifier[obj] , identifier[description] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[result] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Throwable] operator[SEP] {
identifier[Throwable] identifier[t] operator[=] operator[SEP] identifier[Throwable] operator[SEP] identifier[obj] operator[SEP] identifier[StackTraceElement] operator[SEP] operator[SEP] identifier[stack] operator[=] identifier[t] operator[SEP] identifier[getStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stack] operator[!=] Other[null] operator[&&] identifier[stack] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[StackTraceElement] identifier[trace] operator[=] identifier[stack] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
identifier[String] identifier[uri] operator[=] identifier[trace] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[uri] operator[=] identifier[uri] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[uri] operator[=] identifier[uri] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[uri] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] identifier[uri] operator[=] identifier[uri] operator[+] identifier[trace] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] identifier[URL] identifier[url] operator[=] identifier[ClassLoaderUtil] operator[SEP] identifier[getResource] operator[SEP] identifier[uri] , identifier[LocationUtils] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[!=] Other[null] operator[SEP] {
identifier[uri] operator[=] identifier[url] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[description] operator[==] Other[null] operator[SEP] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[trace] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[trace] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[trace] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[trace] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[description] operator[=] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[LocationImpl] operator[SEP] identifier[description] , identifier[uri] , identifier[trace] operator[SEP] identifier[getLineNumber] operator[SEP] operator[SEP] , operator[-] Other[1] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[LocationImpl] operator[SEP] identifier[UNKNOWN] operator[SEP]
}
|
public static boolean executesNonScopeCompensationHandler(PvmExecutionImpl execution) {
ActivityImpl activity = execution.getActivity();
return execution.isScope() && activity != null && activity.isCompensationHandler() && !activity.isScope();
} | class class_name[name] begin[{]
method[executesNonScopeCompensationHandler, return_type[type[boolean]], modifier[public static], parameter[execution]] begin[{]
local_variable[type[ActivityImpl], activity]
return[binary_operation[binary_operation[binary_operation[call[execution.isScope, parameter[]], &&, binary_operation[member[.activity], !=, literal[null]]], &&, call[activity.isCompensationHandler, parameter[]]], &&, call[activity.isScope, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[executesNonScopeCompensationHandler] operator[SEP] identifier[PvmExecutionImpl] identifier[execution] operator[SEP] {
identifier[ActivityImpl] identifier[activity] operator[=] identifier[execution] operator[SEP] identifier[getActivity] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[execution] operator[SEP] identifier[isScope] operator[SEP] operator[SEP] operator[&&] identifier[activity] operator[!=] Other[null] operator[&&] identifier[activity] operator[SEP] identifier[isCompensationHandler] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[activity] operator[SEP] identifier[isScope] operator[SEP] operator[SEP] operator[SEP]
}
|
public MapWithProtoValuesFluentAssertion<M> ignoringFieldAbsenceOfFieldDescriptorsForValues(
Iterable<FieldDescriptor> fieldDescriptors) {
return usingConfig(config.ignoringFieldAbsenceOfFieldDescriptors(fieldDescriptors));
} | class class_name[name] begin[{]
method[ignoringFieldAbsenceOfFieldDescriptorsForValues, return_type[type[MapWithProtoValuesFluentAssertion]], modifier[public], parameter[fieldDescriptors]] begin[{]
return[call[.usingConfig, parameter[call[config.ignoringFieldAbsenceOfFieldDescriptors, parameter[member[.fieldDescriptors]]]]]]
end[}]
END[}] | Keyword[public] identifier[MapWithProtoValuesFluentAssertion] operator[<] identifier[M] operator[>] identifier[ignoringFieldAbsenceOfFieldDescriptorsForValues] operator[SEP] identifier[Iterable] operator[<] identifier[FieldDescriptor] operator[>] identifier[fieldDescriptors] operator[SEP] {
Keyword[return] identifier[usingConfig] operator[SEP] identifier[config] operator[SEP] identifier[ignoringFieldAbsenceOfFieldDescriptors] operator[SEP] identifier[fieldDescriptors] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void copyBackRouteHeader(byte[] source, byte[] dest) {
int thisPointCode = getFromSif_DPC(source, 1);
int remotePointCode = getFromSif_OPC(source, 1);
int sls = getFromSif_SLS(source, 1);
int si = getFromSif_SI(source);
int ssi = getFromSif_SSI(source);
writeRoutingLabel(dest, si, ssi, sls, remotePointCode, thisPointCode);
} | class class_name[name] begin[{]
method[copyBackRouteHeader, return_type[void], modifier[public static], parameter[source, dest]] begin[{]
local_variable[type[int], thisPointCode]
local_variable[type[int], remotePointCode]
local_variable[type[int], sls]
local_variable[type[int], si]
local_variable[type[int], ssi]
call[.writeRoutingLabel, parameter[member[.dest], member[.si], member[.ssi], member[.sls], member[.remotePointCode], member[.thisPointCode]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[copyBackRouteHeader] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[source] , Keyword[byte] operator[SEP] operator[SEP] identifier[dest] operator[SEP] {
Keyword[int] identifier[thisPointCode] operator[=] identifier[getFromSif_DPC] operator[SEP] identifier[source] , Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[remotePointCode] operator[=] identifier[getFromSif_OPC] operator[SEP] identifier[source] , Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[sls] operator[=] identifier[getFromSif_SLS] operator[SEP] identifier[source] , Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[si] operator[=] identifier[getFromSif_SI] operator[SEP] identifier[source] operator[SEP] operator[SEP] Keyword[int] identifier[ssi] operator[=] identifier[getFromSif_SSI] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[writeRoutingLabel] operator[SEP] identifier[dest] , identifier[si] , identifier[ssi] , identifier[sls] , identifier[remotePointCode] , identifier[thisPointCode] operator[SEP] operator[SEP]
}
|
public void setLicenseWindowEndDateTime(com.google.api.ads.admanager.axis.v201808.DateTime licenseWindowEndDateTime) {
this.licenseWindowEndDateTime = licenseWindowEndDateTime;
} | class class_name[name] begin[{]
method[setLicenseWindowEndDateTime, return_type[void], modifier[public], parameter[licenseWindowEndDateTime]] begin[{]
assign[THIS[member[None.licenseWindowEndDateTime]], member[.licenseWindowEndDateTime]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setLicenseWindowEndDateTime] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201808] operator[SEP] identifier[DateTime] identifier[licenseWindowEndDateTime] operator[SEP] {
Keyword[this] operator[SEP] identifier[licenseWindowEndDateTime] operator[=] identifier[licenseWindowEndDateTime] operator[SEP]
}
|
private static double[] getRandomWalk(int numPoints) {
double[] y = new double[numPoints];
y[0] = 0;
for (int i = 1; i < y.length; i++) {
y[i] = y[i - 1] + Math.random() - .5;
}
return y;
} | class class_name[name] begin[{]
method[getRandomWalk, return_type[type[double]], modifier[private static], parameter[numPoints]] begin[{]
local_variable[type[double], y]
assign[member[.y], literal[0]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), operandr=MethodInvocation(arguments=[], member=random, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=.5), operator=-)), 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=y, 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)
return[member[.y]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[double] operator[SEP] operator[SEP] identifier[getRandomWalk] operator[SEP] Keyword[int] identifier[numPoints] operator[SEP] {
Keyword[double] operator[SEP] operator[SEP] identifier[y] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numPoints] operator[SEP] operator[SEP] identifier[y] operator[SEP] Other[0] operator[SEP] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[y] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[y] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[y] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[+] identifier[Math] operator[SEP] identifier[random] operator[SEP] operator[SEP] operator[-] literal[Float] operator[SEP]
}
Keyword[return] identifier[y] operator[SEP]
}
|
public Table createTable(String datasetName, String tableName, String fieldName) {
// [START bigquery_create_table]
TableId tableId = TableId.of(datasetName, tableName);
// Table field definition
Field field = Field.of(fieldName, LegacySQLTypeName.STRING);
// Table schema definition
Schema schema = Schema.of(field);
TableDefinition tableDefinition = StandardTableDefinition.of(schema);
TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build();
Table table = bigquery.create(tableInfo);
// [END bigquery_create_table]
return table;
} | class class_name[name] begin[{]
method[createTable, return_type[type[Table]], modifier[public], parameter[datasetName, tableName, fieldName]] begin[{]
local_variable[type[TableId], tableId]
local_variable[type[Field], field]
local_variable[type[Schema], schema]
local_variable[type[TableDefinition], tableDefinition]
local_variable[type[TableInfo], tableInfo]
local_variable[type[Table], table]
return[member[.table]]
end[}]
END[}] | Keyword[public] identifier[Table] identifier[createTable] operator[SEP] identifier[String] identifier[datasetName] , identifier[String] identifier[tableName] , identifier[String] identifier[fieldName] operator[SEP] {
identifier[TableId] identifier[tableId] operator[=] identifier[TableId] operator[SEP] identifier[of] operator[SEP] identifier[datasetName] , identifier[tableName] operator[SEP] operator[SEP] identifier[Field] identifier[field] operator[=] identifier[Field] operator[SEP] identifier[of] operator[SEP] identifier[fieldName] , identifier[LegacySQLTypeName] operator[SEP] identifier[STRING] operator[SEP] operator[SEP] identifier[Schema] identifier[schema] operator[=] identifier[Schema] operator[SEP] identifier[of] operator[SEP] identifier[field] operator[SEP] operator[SEP] identifier[TableDefinition] identifier[tableDefinition] operator[=] identifier[StandardTableDefinition] operator[SEP] identifier[of] operator[SEP] identifier[schema] operator[SEP] operator[SEP] identifier[TableInfo] identifier[tableInfo] operator[=] identifier[TableInfo] operator[SEP] identifier[newBuilder] operator[SEP] identifier[tableId] , identifier[tableDefinition] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[Table] identifier[table] operator[=] identifier[bigquery] operator[SEP] identifier[create] operator[SEP] identifier[tableInfo] operator[SEP] operator[SEP] Keyword[return] identifier[table] operator[SEP]
}
|
void remove() throws InternalLogException
{
if (tc.isEntryEnabled()) Tr.entry(tc, "remove",this);
// If the parent recovery log instance has experienced a serious internal error then prevent
// this operation from executing.
if (_recLog.failed())
{
if (tc.isEntryEnabled()) Tr.exit(tc, "remove",this);
throw new InternalLogException(null);
}
// Next, "forget" all stored recoverable unit sections. This will ensure that no further
// reference to this recoverable unit can be written to disk even if the client service
// invokes a write or force method on it in the future. We also need to clear out the
// total and unwritten data size fields to ensure that we don't attempt to begin
// writing even when there are no sections to write.
if (tc.isEventEnabled()) Tr.event(tc, "Remove completed for recoverable unit " + _identity + ". Clear internal state");
_recoverableUnitSections.clear();
if (tc.isEntryEnabled()) Tr.exit(tc, "remove");
} | class class_name[name] begin[{]
method[remove, return_type[void], modifier[default], parameter[]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.entry, parameter[member[.tc], literal["remove"], THIS[]]]
else begin[{]
None
end[}]
if[call[_recLog.failed, parameter[]]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["remove"], THIS[]]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[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=InternalLogException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[tc.isEventEnabled, parameter[]]] begin[{]
call[Tr.event, parameter[member[.tc], binary_operation[binary_operation[literal["Remove completed for recoverable unit "], +, member[._identity]], +, literal[". Clear internal state"]]]]
else begin[{]
None
end[}]
call[_recoverableUnitSections.clear, parameter[]]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["remove"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[void] identifier[remove] operator[SEP] operator[SEP] Keyword[throws] identifier[InternalLogException] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_recLog] operator[SEP] identifier[failed] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InternalLogException] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[_identity] operator[+] literal[String] operator[SEP] operator[SEP] identifier[_recoverableUnitSections] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
public Observable<Void> reissueAsync(String resourceGroupName, String certificateOrderName, ReissueCertificateOrderRequest reissueCertificateOrderRequest) {
return reissueWithServiceResponseAsync(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[reissueAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, certificateOrderName, reissueCertificateOrderRequest]] begin[{]
return[call[.reissueWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.certificateOrderName], member[.reissueCertificateOrderRequest]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[Void] operator[>] identifier[reissueAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[certificateOrderName] , identifier[ReissueCertificateOrderRequest] identifier[reissueCertificateOrderRequest] operator[SEP] {
Keyword[return] identifier[reissueWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[certificateOrderName] , identifier[reissueCertificateOrderRequest] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] , identifier[Void] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Void] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public static String getRelativePath(String path, String backupDirCanonicalPath) throws MalformedURLException
{
URL urlPath = new URL(resolveFileURL("file:" + path));
URL urlBackupDir = new URL(resolveFileURL("file:" + backupDirCanonicalPath));
return urlPath.toString().replace(urlBackupDir.toString() + "/", "");
} | class class_name[name] begin[{]
method[getRelativePath, return_type[type[String]], modifier[public static], parameter[path, backupDirCanonicalPath]] begin[{]
local_variable[type[URL], urlPath]
local_variable[type[URL], urlBackupDir]
return[call[urlPath.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getRelativePath] operator[SEP] identifier[String] identifier[path] , identifier[String] identifier[backupDirCanonicalPath] operator[SEP] Keyword[throws] identifier[MalformedURLException] {
identifier[URL] identifier[urlPath] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[resolveFileURL] operator[SEP] literal[String] operator[+] identifier[path] operator[SEP] operator[SEP] operator[SEP] identifier[URL] identifier[urlBackupDir] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[resolveFileURL] operator[SEP] literal[String] operator[+] identifier[backupDirCanonicalPath] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[urlPath] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] identifier[urlBackupDir] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] , literal[String] operator[SEP] operator[SEP]
}
|
@Override
public void setupEventHandlers() {
node.setOnMouseEntered(event -> toggleTooltip(node, checkboxes.get(checkboxes.size() - 1)));
node.setOnMouseExited(event -> toggleTooltip(node, checkboxes.get(checkboxes.size() - 1)));
setupCheckboxEventHandlers();
} | class class_name[name] begin[{]
method[setupEventHandlers, return_type[void], modifier[public], parameter[]] begin[{]
call[node.setOnMouseEntered, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=checkboxes, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=get, postfix_operators=[], prefix_operators=[], qualifier=checkboxes, selectors=[], type_arguments=None)], member=toggleTooltip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
call[node.setOnMouseExited, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=checkboxes, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=get, postfix_operators=[], prefix_operators=[], qualifier=checkboxes, selectors=[], type_arguments=None)], member=toggleTooltip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
call[.setupCheckboxEventHandlers, parameter[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setupEventHandlers] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setOnMouseEntered] operator[SEP] identifier[event] operator[->] identifier[toggleTooltip] operator[SEP] identifier[node] , identifier[checkboxes] operator[SEP] identifier[get] operator[SEP] identifier[checkboxes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[setOnMouseExited] operator[SEP] identifier[event] operator[->] identifier[toggleTooltip] operator[SEP] identifier[node] , identifier[checkboxes] operator[SEP] identifier[get] operator[SEP] identifier[checkboxes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setupCheckboxEventHandlers] operator[SEP] operator[SEP] operator[SEP]
}
|
public static SelectOptions getProjectSelectOptionsStatic(CmsObject cms, String startProject, Locale locale) {
List<CmsProject> allProjects;
try {
String ouFqn = "";
CmsUserSettings settings = new CmsUserSettings(cms);
if (!settings.getListAllProjects()) {
ouFqn = cms.getRequestContext().getCurrentUser().getOuFqn();
}
allProjects = OpenCms.getOrgUnitManager().getAllAccessibleProjects(
cms,
ouFqn,
settings.getListAllProjects());
} catch (CmsException e) {
// should usually never happen
if (LOG.isErrorEnabled()) {
LOG.error(e.getLocalizedMessage(), e);
}
allProjects = Collections.emptyList();
}
boolean singleOu = true;
String ouFqn = null;
Iterator<CmsProject> itProjects = allProjects.iterator();
while (itProjects.hasNext()) {
CmsProject prj = itProjects.next();
if (prj.isOnlineProject()) {
// skip the online project
continue;
}
if (ouFqn == null) {
// set the first ou
ouFqn = prj.getOuFqn();
}
if (!ouFqn.equals(prj.getOuFqn())) {
// break if one different ou is found
singleOu = false;
break;
}
}
List<String> options = new ArrayList<String>(allProjects.size());
List<String> values = new ArrayList<String>(allProjects.size());
int checkedIndex = 0;
for (int i = 0, n = allProjects.size(); i < n; i++) {
CmsProject project = allProjects.get(i);
String projectName = project.getSimpleName();
if (!singleOu && !project.isOnlineProject()) {
try {
projectName = projectName
+ " - "
+ OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, project.getOuFqn()).getDisplayName(
locale);
} catch (CmsException e) {
projectName = projectName + " - " + project.getOuFqn();
}
}
options.add(projectName);
values.add(project.getName());
if (startProject.equals(project.getName())) {
checkedIndex = i;
}
}
SelectOptions selectOptions = new SelectOptions(options, values, checkedIndex);
return selectOptions;
} | class class_name[name] begin[{]
method[getProjectSelectOptionsStatic, return_type[type[SelectOptions]], modifier[public static], parameter[cms, startProject, locale]] begin[{]
local_variable[type[List], allProjects]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=ouFqn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=cms, 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=CmsUserSettings, sub_type=None)), name=settings)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsUserSettings, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getListAllProjects, postfix_operators=[], prefix_operators=['!'], qualifier=settings, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ouFqn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getRequestContext, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[MethodInvocation(arguments=[], member=getCurrentUser, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getOuFqn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=allProjects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getOrgUnitManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ouFqn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getListAllProjects, postfix_operators=[], prefix_operators=[], qualifier=settings, selectors=[], type_arguments=None)], member=getAllAccessibleProjects, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=allProjects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=emptyList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)
local_variable[type[boolean], singleOu]
local_variable[type[String], ouFqn]
local_variable[type[Iterator], itProjects]
while[call[itProjects.hasNext, parameter[]]] begin[{]
local_variable[type[CmsProject], prj]
if[call[prj.isOnlineProject, parameter[]]] begin[{]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.ouFqn], ==, literal[null]]] begin[{]
assign[member[.ouFqn], call[prj.getOuFqn, parameter[]]]
else begin[{]
None
end[}]
if[call[ouFqn.equals, parameter[call[prj.getOuFqn, parameter[]]]]] begin[{]
assign[member[.singleOu], literal[false]]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
end[}]
local_variable[type[List], options]
local_variable[type[List], values]
local_variable[type[int], checkedIndex]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=allProjects, selectors=[], type_arguments=None), name=project)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsProject, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=project, selectors=[], type_arguments=None), name=projectName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=singleOu, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isOnlineProject, postfix_operators=[], prefix_operators=['!'], qualifier=project, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=projectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=projectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[], member=getOrgUnitManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getOuFqn, postfix_operators=[], prefix_operators=[], qualifier=project, selectors=[], type_arguments=None)], member=readOrganizationalUnit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDisplayName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=projectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=projectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[], member=getOuFqn, postfix_operators=[], prefix_operators=[], qualifier=project, selectors=[], type_arguments=None), operator=+)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=projectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=project, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=project, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=startProject, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=checkedIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=allProjects, selectors=[], type_arguments=None), name=n)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[SelectOptions], selectOptions]
return[member[.selectOptions]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[SelectOptions] identifier[getProjectSelectOptionsStatic] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[String] identifier[startProject] , identifier[Locale] identifier[locale] operator[SEP] {
identifier[List] operator[<] identifier[CmsProject] operator[>] identifier[allProjects] operator[SEP] Keyword[try] {
identifier[String] identifier[ouFqn] operator[=] literal[String] operator[SEP] identifier[CmsUserSettings] identifier[settings] operator[=] Keyword[new] identifier[CmsUserSettings] operator[SEP] identifier[cms] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[settings] operator[SEP] identifier[getListAllProjects] operator[SEP] operator[SEP] operator[SEP] {
identifier[ouFqn] operator[=] identifier[cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentUser] operator[SEP] operator[SEP] operator[SEP] identifier[getOuFqn] operator[SEP] operator[SEP] operator[SEP]
}
identifier[allProjects] operator[=] identifier[OpenCms] operator[SEP] identifier[getOrgUnitManager] operator[SEP] operator[SEP] operator[SEP] identifier[getAllAccessibleProjects] operator[SEP] identifier[cms] , identifier[ouFqn] , identifier[settings] operator[SEP] identifier[getListAllProjects] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
identifier[allProjects] operator[=] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[singleOu] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[ouFqn] operator[=] Other[null] operator[SEP] identifier[Iterator] operator[<] identifier[CmsProject] operator[>] identifier[itProjects] operator[=] identifier[allProjects] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itProjects] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[CmsProject] identifier[prj] operator[=] identifier[itProjects] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prj] operator[SEP] identifier[isOnlineProject] operator[SEP] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ouFqn] operator[==] Other[null] operator[SEP] {
identifier[ouFqn] operator[=] identifier[prj] operator[SEP] identifier[getOuFqn] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[ouFqn] operator[SEP] identifier[equals] operator[SEP] identifier[prj] operator[SEP] identifier[getOuFqn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[singleOu] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
identifier[List] operator[<] identifier[String] operator[>] identifier[options] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[allProjects] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[values] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[allProjects] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[checkedIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[n] operator[=] identifier[allProjects] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[CmsProject] identifier[project] operator[=] identifier[allProjects] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[projectName] operator[=] identifier[project] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[singleOu] operator[&&] operator[!] identifier[project] operator[SEP] identifier[isOnlineProject] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[projectName] operator[=] identifier[projectName] operator[+] literal[String] operator[+] identifier[OpenCms] operator[SEP] identifier[getOrgUnitManager] operator[SEP] operator[SEP] operator[SEP] identifier[readOrganizationalUnit] operator[SEP] identifier[cms] , identifier[project] operator[SEP] identifier[getOuFqn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getDisplayName] operator[SEP] identifier[locale] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
identifier[projectName] operator[=] identifier[projectName] operator[+] literal[String] operator[+] identifier[project] operator[SEP] identifier[getOuFqn] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[options] operator[SEP] identifier[add] operator[SEP] identifier[projectName] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[project] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startProject] operator[SEP] identifier[equals] operator[SEP] identifier[project] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[checkedIndex] operator[=] identifier[i] operator[SEP]
}
}
identifier[SelectOptions] identifier[selectOptions] operator[=] Keyword[new] identifier[SelectOptions] operator[SEP] identifier[options] , identifier[values] , identifier[checkedIndex] operator[SEP] operator[SEP] Keyword[return] identifier[selectOptions] operator[SEP]
}
|
public CellConstraints rchw(int row, int col, int rowSpan, int colSpan,
String encodedAlignments) {
CellConstraints result = rchw(row, col, rowSpan, colSpan);
result.setAlignments(encodedAlignments, false);
return result;
} | class class_name[name] begin[{]
method[rchw, return_type[type[CellConstraints]], modifier[public], parameter[row, col, rowSpan, colSpan, encodedAlignments]] begin[{]
local_variable[type[CellConstraints], result]
call[result.setAlignments, parameter[member[.encodedAlignments], literal[false]]]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[CellConstraints] identifier[rchw] operator[SEP] Keyword[int] identifier[row] , Keyword[int] identifier[col] , Keyword[int] identifier[rowSpan] , Keyword[int] identifier[colSpan] , identifier[String] identifier[encodedAlignments] operator[SEP] {
identifier[CellConstraints] identifier[result] operator[=] identifier[rchw] operator[SEP] identifier[row] , identifier[col] , identifier[rowSpan] , identifier[colSpan] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setAlignments] operator[SEP] identifier[encodedAlignments] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
boolean addObserver(ApptentiveNotificationObserver observer, boolean useWeakReference) {
if (observer == null) {
throw new IllegalArgumentException("Observer is null");
}
if (!contains(observer)) {
observers.add(useWeakReference ? new ObserverWeakReference(observer) : observer);
return true;
}
return false;
} | class class_name[name] begin[{]
method[addObserver, return_type[type[boolean]], modifier[default], parameter[observer, useWeakReference]] begin[{]
if[binary_operation[member[.observer], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Observer is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[.contains, parameter[member[.observer]]]] begin[{]
call[observers.add, parameter[TernaryExpression(condition=MemberReference(member=useWeakReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=observer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=ClassCreator(arguments=[MemberReference(member=observer, 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=ObserverWeakReference, sub_type=None)))]]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[boolean] identifier[addObserver] operator[SEP] identifier[ApptentiveNotificationObserver] identifier[observer] , Keyword[boolean] identifier[useWeakReference] operator[SEP] {
Keyword[if] operator[SEP] identifier[observer] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[contains] operator[SEP] identifier[observer] operator[SEP] operator[SEP] {
identifier[observers] operator[SEP] identifier[add] operator[SEP] identifier[useWeakReference] operator[?] Keyword[new] identifier[ObserverWeakReference] operator[SEP] identifier[observer] operator[SEP] operator[:] identifier[observer] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
@Override
public void updateStatisticOnRequest(int dataId) {
if (si != null) {
ConnectionPoolStats temp = ConnectionPoolMonitor.getConnectionPoolOB((si.getName()));
if (dataId == NUM_CREATES) {
numManagedConnectionsCreated.setCount(temp.getCreateCount());
}
if (dataId == NUM_DESTROYS) {
numManagedConnectionsDestroyed.setCount(temp.getDestroyCount());
}
if (dataId == NUM_MANAGED_CONNECTIONS) {
numManagedConnections.setCount(temp.getManagedConnectionCount());
}
if (dataId == NUM_CONNECTIONS) {
numConnectionHandles.setCount(temp.getConnectionHandleCount());
}
if (dataId == AVERAGE_WAIT) {
averageWait.set(((long) temp.getWaitTime()), (long) temp.getWaitTime(), (long) temp.getWaitTime(), 0, 0, 0, 0);
}
if (dataId == FREE_POOL_SIZE) {
freePoolSize.set(temp.getFreeConnectionCount());
}
}
} | class class_name[name] begin[{]
method[updateStatisticOnRequest, return_type[void], modifier[public], parameter[dataId]] begin[{]
if[binary_operation[member[.si], !=, literal[null]]] begin[{]
local_variable[type[ConnectionPoolStats], temp]
if[binary_operation[member[.dataId], ==, member[.NUM_CREATES]]] begin[{]
call[numManagedConnectionsCreated.setCount, parameter[call[temp.getCreateCount, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.dataId], ==, member[.NUM_DESTROYS]]] begin[{]
call[numManagedConnectionsDestroyed.setCount, parameter[call[temp.getDestroyCount, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.dataId], ==, member[.NUM_MANAGED_CONNECTIONS]]] begin[{]
call[numManagedConnections.setCount, parameter[call[temp.getManagedConnectionCount, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.dataId], ==, member[.NUM_CONNECTIONS]]] begin[{]
call[numConnectionHandles.setCount, parameter[call[temp.getConnectionHandleCount, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.dataId], ==, member[.AVERAGE_WAIT]]] begin[{]
call[averageWait.set, parameter[Cast(expression=MethodInvocation(arguments=[], member=getWaitTime, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), Cast(expression=MethodInvocation(arguments=[], member=getWaitTime, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), Cast(expression=MethodInvocation(arguments=[], member=getWaitTime, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), literal[0], literal[0], literal[0], literal[0]]]
else begin[{]
None
end[}]
if[binary_operation[member[.dataId], ==, member[.FREE_POOL_SIZE]]] begin[{]
call[freePoolSize.set, parameter[call[temp.getFreeConnectionCount, parameter[]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[updateStatisticOnRequest] operator[SEP] Keyword[int] identifier[dataId] operator[SEP] {
Keyword[if] operator[SEP] identifier[si] operator[!=] Other[null] operator[SEP] {
identifier[ConnectionPoolStats] identifier[temp] operator[=] identifier[ConnectionPoolMonitor] operator[SEP] identifier[getConnectionPoolOB] operator[SEP] operator[SEP] identifier[si] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dataId] operator[==] identifier[NUM_CREATES] operator[SEP] {
identifier[numManagedConnectionsCreated] operator[SEP] identifier[setCount] operator[SEP] identifier[temp] operator[SEP] identifier[getCreateCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[dataId] operator[==] identifier[NUM_DESTROYS] operator[SEP] {
identifier[numManagedConnectionsDestroyed] operator[SEP] identifier[setCount] operator[SEP] identifier[temp] operator[SEP] identifier[getDestroyCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[dataId] operator[==] identifier[NUM_MANAGED_CONNECTIONS] operator[SEP] {
identifier[numManagedConnections] operator[SEP] identifier[setCount] operator[SEP] identifier[temp] operator[SEP] identifier[getManagedConnectionCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[dataId] operator[==] identifier[NUM_CONNECTIONS] operator[SEP] {
identifier[numConnectionHandles] operator[SEP] identifier[setCount] operator[SEP] identifier[temp] operator[SEP] identifier[getConnectionHandleCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[dataId] operator[==] identifier[AVERAGE_WAIT] operator[SEP] {
identifier[averageWait] operator[SEP] identifier[set] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[temp] operator[SEP] identifier[getWaitTime] operator[SEP] operator[SEP] operator[SEP] , operator[SEP] Keyword[long] operator[SEP] identifier[temp] operator[SEP] identifier[getWaitTime] operator[SEP] operator[SEP] , operator[SEP] Keyword[long] operator[SEP] identifier[temp] operator[SEP] identifier[getWaitTime] operator[SEP] operator[SEP] , Other[0] , Other[0] , Other[0] , Other[0] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[dataId] operator[==] identifier[FREE_POOL_SIZE] operator[SEP] {
identifier[freePoolSize] operator[SEP] identifier[set] operator[SEP] identifier[temp] operator[SEP] identifier[getFreeConnectionCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
private void invokeReflection(Method method, String signature) {
GeneratorAdapter mg = new GeneratorAdapter(Opcodes.ACC_PUBLIC, method, signature, new Type[0], classWriter);
/**
* try {
* // Call method
* } catch (IllegalAccessException e) {
* throw Throwables.propagate(e);
* }
*/
Label beginTry = mg.newLabel();
Label endTry = mg.newLabel();
Label catchHandle = mg.newLabel();
mg.visitTryCatchBlock(beginTry, endTry, catchHandle, Type.getInternalName(IllegalAccessException.class));
mg.mark(beginTry);
mg.loadThis();
mg.getField(Type.getObjectType(className), "field", Type.getType(Field.class));
mg.loadArgs();
mg.invokeVirtual(Type.getType(Field.class), method);
mg.mark(endTry);
mg.returnValue();
mg.mark(catchHandle);
int exception = mg.newLocal(Type.getType(IllegalAccessException.class));
mg.storeLocal(exception);
mg.loadLocal(exception);
mg.invokeStatic(Type.getType(Throwables.class),
getMethod(RuntimeException.class, "propagate", Throwable.class));
mg.throwException();
mg.endMethod();
} | class class_name[name] begin[{]
method[invokeReflection, return_type[void], modifier[private], parameter[method, signature]] begin[{]
local_variable[type[GeneratorAdapter], mg]
local_variable[type[Label], beginTry]
local_variable[type[Label], endTry]
local_variable[type[Label], catchHandle]
call[mg.visitTryCatchBlock, parameter[member[.beginTry], member[.endTry], member[.catchHandle], call[Type.getInternalName, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalAccessException, sub_type=None))]]]]
call[mg.mark, parameter[member[.beginTry]]]
call[mg.loadThis, parameter[]]
call[mg.getField, parameter[call[Type.getObjectType, parameter[member[.className]]], literal["field"], call[Type.getType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Field, sub_type=None))]]]]
call[mg.loadArgs, parameter[]]
call[mg.invokeVirtual, parameter[call[Type.getType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Field, sub_type=None))]], member[.method]]]
call[mg.mark, parameter[member[.endTry]]]
call[mg.returnValue, parameter[]]
call[mg.mark, parameter[member[.catchHandle]]]
local_variable[type[int], exception]
call[mg.storeLocal, parameter[member[.exception]]]
call[mg.loadLocal, parameter[member[.exception]]]
call[mg.invokeStatic, parameter[call[Type.getType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Throwables, sub_type=None))]], call[.getMethod, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), literal["propagate"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Throwable, sub_type=None))]]]]
call[mg.throwException, parameter[]]
call[mg.endMethod, parameter[]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[invokeReflection] operator[SEP] identifier[Method] identifier[method] , identifier[String] identifier[signature] operator[SEP] {
identifier[GeneratorAdapter] identifier[mg] operator[=] Keyword[new] identifier[GeneratorAdapter] operator[SEP] identifier[Opcodes] operator[SEP] identifier[ACC_PUBLIC] , identifier[method] , identifier[signature] , Keyword[new] identifier[Type] operator[SEP] Other[0] operator[SEP] , identifier[classWriter] operator[SEP] operator[SEP] identifier[Label] identifier[beginTry] operator[=] identifier[mg] operator[SEP] identifier[newLabel] operator[SEP] operator[SEP] operator[SEP] identifier[Label] identifier[endTry] operator[=] identifier[mg] operator[SEP] identifier[newLabel] operator[SEP] operator[SEP] operator[SEP] identifier[Label] identifier[catchHandle] operator[=] identifier[mg] operator[SEP] identifier[newLabel] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitTryCatchBlock] operator[SEP] identifier[beginTry] , identifier[endTry] , identifier[catchHandle] , identifier[Type] operator[SEP] identifier[getInternalName] operator[SEP] identifier[IllegalAccessException] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[mark] operator[SEP] identifier[beginTry] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[loadThis] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[getField] operator[SEP] identifier[Type] operator[SEP] identifier[getObjectType] operator[SEP] identifier[className] operator[SEP] , literal[String] , identifier[Type] operator[SEP] identifier[getType] operator[SEP] identifier[Field] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[loadArgs] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[invokeVirtual] operator[SEP] identifier[Type] operator[SEP] identifier[getType] operator[SEP] identifier[Field] operator[SEP] Keyword[class] operator[SEP] , identifier[method] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[mark] operator[SEP] identifier[endTry] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[returnValue] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[mark] operator[SEP] identifier[catchHandle] operator[SEP] operator[SEP] Keyword[int] identifier[exception] operator[=] identifier[mg] operator[SEP] identifier[newLocal] operator[SEP] identifier[Type] operator[SEP] identifier[getType] operator[SEP] identifier[IllegalAccessException] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[storeLocal] operator[SEP] identifier[exception] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[loadLocal] operator[SEP] identifier[exception] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[invokeStatic] operator[SEP] identifier[Type] operator[SEP] identifier[getType] operator[SEP] identifier[Throwables] operator[SEP] Keyword[class] operator[SEP] , identifier[getMethod] operator[SEP] identifier[RuntimeException] operator[SEP] Keyword[class] , literal[String] , identifier[Throwable] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[throwException] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[endMethod] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <T> T invokeStatic(Method method, Object... args) throws UtilException {
return invoke(null, method, args);
} | class class_name[name] begin[{]
method[invokeStatic, return_type[type[T]], modifier[public static], parameter[method, args]] begin[{]
return[call[.invoke, parameter[literal[null], member[.method], member[.args]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[invokeStatic] operator[SEP] identifier[Method] identifier[method] , identifier[Object] operator[...] identifier[args] operator[SEP] Keyword[throws] identifier[UtilException] {
Keyword[return] identifier[invoke] operator[SEP] Other[null] , identifier[method] , identifier[args] operator[SEP] operator[SEP]
}
|
public Optional<ApplicationHost> show(long applicationId, long hostId)
{
return HTTP.GET(String.format("/v2/applications/%d/hosts/%d.json", applicationId, hostId), APPLICATION_HOST);
} | class class_name[name] begin[{]
method[show, return_type[type[Optional]], modifier[public], parameter[applicationId, hostId]] begin[{]
return[call[HTTP.GET, parameter[call[String.format, parameter[literal["/v2/applications/%d/hosts/%d.json"], member[.applicationId], member[.hostId]]], member[.APPLICATION_HOST]]]]
end[}]
END[}] | Keyword[public] identifier[Optional] operator[<] identifier[ApplicationHost] operator[>] identifier[show] operator[SEP] Keyword[long] identifier[applicationId] , Keyword[long] identifier[hostId] operator[SEP] {
Keyword[return] identifier[HTTP] operator[SEP] identifier[GET] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[applicationId] , identifier[hostId] operator[SEP] , identifier[APPLICATION_HOST] operator[SEP] operator[SEP]
}
|
@Override
public boolean isConnected() {
if (log.isTraceEnabled()) {
log.trace("Connected: {}", (ioSession != null && ioSession.isConnected()));
}
// XXX Paul: not sure isClosing is actually working as we expect here
return super.isConnected() && (ioSession != null && ioSession.isConnected());
} | class class_name[name] begin[{]
method[isConnected, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
if[call[log.isTraceEnabled, parameter[]]] begin[{]
call[log.trace, parameter[literal["Connected: {}"], binary_operation[binary_operation[member[.ioSession], !=, literal[null]], &&, call[ioSession.isConnected, parameter[]]]]]
else begin[{]
None
end[}]
return[binary_operation[SuperMethodInvocation(arguments=[], member=isConnected, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), &&, binary_operation[binary_operation[member[.ioSession], !=, literal[null]], &&, call[ioSession.isConnected, parameter[]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isConnected] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] , operator[SEP] identifier[ioSession] operator[!=] Other[null] operator[&&] identifier[ioSession] operator[SEP] identifier[isConnected] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[isConnected] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[ioSession] operator[!=] Other[null] operator[&&] identifier[ioSession] operator[SEP] identifier[isConnected] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private static long compactValFor(BigInteger b) {
int[] m = b.mag;
int len = m.length;
if (len == 0)
return 0;
int d = m[0];
if (len > 2 || (len == 2 && d < 0))
return INFLATED;
long u = (len == 2)?
(((long) m[1] & LONG_MASK) + (((long)d) << 32)) :
(((long)d) & LONG_MASK);
return (b.signum < 0)? -u : u;
} | class class_name[name] begin[{]
method[compactValFor, return_type[type[long]], modifier[private static], parameter[b]] begin[{]
local_variable[type[int], m]
local_variable[type[int], len]
if[binary_operation[member[.len], ==, literal[0]]] begin[{]
return[literal[0]]
else begin[{]
None
end[}]
local_variable[type[int], d]
if[binary_operation[binary_operation[member[.len], >, literal[2]], ||, binary_operation[binary_operation[member[.len], ==, literal[2]], &&, binary_operation[member[.d], <, literal[0]]]]] begin[{]
return[member[.INFLATED]]
else begin[{]
None
end[}]
local_variable[type[long], u]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=signum, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=u, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]))]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[long] identifier[compactValFor] operator[SEP] identifier[BigInteger] identifier[b] operator[SEP] {
Keyword[int] operator[SEP] operator[SEP] identifier[m] operator[=] identifier[b] operator[SEP] identifier[mag] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[m] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[==] Other[0] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[int] identifier[d] operator[=] identifier[m] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>] Other[2] operator[||] operator[SEP] identifier[len] operator[==] Other[2] operator[&&] identifier[d] operator[<] Other[0] operator[SEP] operator[SEP] Keyword[return] identifier[INFLATED] operator[SEP] Keyword[long] identifier[u] operator[=] operator[SEP] identifier[len] operator[==] Other[2] operator[SEP] operator[?] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[m] operator[SEP] Other[1] operator[SEP] operator[&] identifier[LONG_MASK] operator[SEP] operator[+] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[d] operator[SEP] operator[<<] Other[32] operator[SEP] operator[SEP] operator[:] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[d] operator[SEP] operator[&] identifier[LONG_MASK] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[b] operator[SEP] identifier[signum] operator[<] Other[0] operator[SEP] operator[?] operator[-] identifier[u] operator[:] identifier[u] operator[SEP]
}
|
public final void mSTRING_WITH_QUOTE() throws RecognitionException {
try {
int _type = STRING_WITH_QUOTE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:149:3: ( '\\'' ( options {greedy=false; } :~ ( '\\u0027' | '\\u005C' | '\\u000A' | '\\u000D' ) | ECHAR )* '\\'' )
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:149:5: '\\'' ( options {greedy=false; } :~ ( '\\u0027' | '\\u005C' | '\\u000A' | '\\u000D' ) | ECHAR )* '\\''
{
match('\'');
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:149:10: ( options {greedy=false; } :~ ( '\\u0027' | '\\u005C' | '\\u000A' | '\\u000D' ) | ECHAR )*
loop2:
do {
int alt2=3;
int LA2_0 = input.LA(1);
if ( ((LA2_0 >= '\u0000' && LA2_0 <= '\t')||(LA2_0 >= '\u000B' && LA2_0 <= '\f')||(LA2_0 >= '\u000E' && LA2_0 <= '&')||(LA2_0 >= '(' && LA2_0 <= '[')||(LA2_0 >= ']' && LA2_0 <= '\uFFFF')) ) {
alt2=1;
}
else if ( (LA2_0=='\\') ) {
alt2=2;
}
else if ( (LA2_0=='\'') ) {
alt2=3;
}
switch (alt2) {
case 1 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:149:40: ~ ( '\\u0027' | '\\u005C' | '\\u000A' | '\\u000D' )
{
if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '\f')||(input.LA(1) >= '\u000E' && input.LA(1) <= '&')||(input.LA(1) >= '(' && input.LA(1) <= '[')||(input.LA(1) >= ']' && input.LA(1) <= '\uFFFF') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;
}
}
break;
case 2 :
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:149:87: ECHAR
{
mECHAR();
}
break;
default :
break loop2;
}
} while (true);
match('\'');
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
} | class class_name[name] begin[{]
method[mSTRING_WITH_QUOTE, return_type[void], modifier[final public], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=STRING_WITH_QUOTE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_TOKEN_CHANNEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_channel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), DoStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), name=alt2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA2_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t'), operator=<=), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=''), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\f'), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=''), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='&'), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='('), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='['), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=']'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=''), operator=<=), operator=&&), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\''), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), operator=>=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t'), operator=<=), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=''), operator=>=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\f'), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=''), operator=>=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='&'), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='('), operator=>=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='['), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=']'), operator=>=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=''), operator=<=), operator=&&), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MismatchedSetException, sub_type=None)), name=mse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MismatchedSetException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=mse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=consume, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None)]))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=mECHAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=loop2, label=None)])], expression=MemberReference(member=alt2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=loop2), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[mSTRING_WITH_QUOTE] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
Keyword[try] {
Keyword[int] identifier[_type] operator[=] identifier[STRING_WITH_QUOTE] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] {
identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[loop2] operator[:] Keyword[do] {
Keyword[int] identifier[alt2] operator[=] Other[3] operator[SEP] Keyword[int] identifier[LA2_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[LA2_0] operator[>=] literal[String] operator[&&] identifier[LA2_0] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[LA2_0] operator[>=] literal[String] operator[&&] identifier[LA2_0] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[LA2_0] operator[>=] literal[String] operator[&&] identifier[LA2_0] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[LA2_0] operator[>=] literal[String] operator[&&] identifier[LA2_0] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[LA2_0] operator[>=] literal[String] operator[&&] identifier[LA2_0] operator[<=] literal[String] operator[SEP] operator[SEP] operator[SEP] {
identifier[alt2] operator[=] Other[1] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[LA2_0] operator[==] literal[String] operator[SEP] operator[SEP] {
identifier[alt2] operator[=] Other[2] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[LA2_0] operator[==] literal[String] operator[SEP] operator[SEP] {
identifier[alt2] operator[=] Other[3] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[alt2] operator[SEP] {
Keyword[case] Other[1] operator[:] {
Keyword[if] operator[SEP] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[>=] literal[String] operator[&&] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[>=] literal[String] operator[&&] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[>=] literal[String] operator[&&] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[>=] literal[String] operator[&&] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[>=] literal[String] operator[&&] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[<=] literal[String] operator[SEP] operator[SEP] {
identifier[input] operator[SEP] identifier[consume] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[MismatchedSetException] identifier[mse] operator[=] Keyword[new] identifier[MismatchedSetException] operator[SEP] Other[null] , identifier[input] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[mse] operator[SEP] operator[SEP] Keyword[throw] identifier[mse] operator[SEP]
}
}
Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] {
identifier[mECHAR] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] identifier[loop2] operator[SEP]
}
}
Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[state] operator[SEP] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[state] operator[SEP] identifier[channel] operator[=] identifier[_channel] operator[SEP]
}
Keyword[finally] {
}
}
|
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
protected void onString(String text, String fieldName, JsonParser jp) {
log.trace(fieldName + " " + text);
if (resultStarted) {
found = true;
java.lang.reflect.Field field = ClassUtil.getDeclaredFieldSilent(entity.getClass(), fieldName);
if (field != null) {
if (field.isAnnotationPresent(Reference.class)) {
ClassUtil.setSilent(entity, fieldName, ProxyUtil.createLazyProxy(field.getType(), daoSupport, text));
} else if (field.isAnnotationPresent(Column.class)) {
if (field.isAnnotationPresent(Codec.class)) {
Class<? extends com.apitrary.orm.core.codec.Codec> codecClazz = ClassUtil.getFieldAnnotationValue("value", field, Codec.class, Class.class);
com.apitrary.orm.core.codec.Codec codec = (com.apitrary.orm.core.codec.Codec) ClassUtil.newInstance(codecClazz);
Object value = codec.decode(text);
ClassUtil.setSilent(entity, fieldName, value);
} else {
ClassUtil.setSilent(entity, fieldName, text);
}
}
}
}
} | class class_name[name] begin[{]
method[onString, return_type[void], modifier[protected], parameter[text, fieldName, jp]] begin[{]
call[log.trace, parameter[binary_operation[binary_operation[member[.fieldName], +, literal[" "]], +, member[.text]]]]
if[member[.resultStarted]] begin[{]
assign[member[.found], literal[true]]
local_variable[type[java], field]
if[binary_operation[member[.field], !=, literal[null]]] begin[{]
if[call[field.isAnnotationPresent, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Reference, sub_type=None))]]] begin[{]
call[ClassUtil.setSilent, parameter[member[.entity], member[.fieldName], call[ProxyUtil.createLazyProxy, parameter[call[field.getType, parameter[]], member[.daoSupport], member[.text]]]]]
else begin[{]
if[call[field.isAnnotationPresent, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Column, sub_type=None))]]] begin[{]
if[call[field.isAnnotationPresent, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Codec, sub_type=None))]]] begin[{]
local_variable[type[Class], codecClazz]
local_variable[type[com], codec]
local_variable[type[Object], value]
call[ClassUtil.setSilent, parameter[member[.entity], member[.fieldName], member[.value]]]
else begin[{]
call[ClassUtil.setSilent, parameter[member[.entity], member[.fieldName], member[.text]]]
end[}]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] Keyword[protected] Keyword[void] identifier[onString] operator[SEP] identifier[String] identifier[text] , identifier[String] identifier[fieldName] , identifier[JsonParser] identifier[jp] operator[SEP] {
identifier[log] operator[SEP] identifier[trace] operator[SEP] identifier[fieldName] operator[+] literal[String] operator[+] identifier[text] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resultStarted] operator[SEP] {
identifier[found] operator[=] literal[boolean] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[reflect] operator[SEP] identifier[Field] identifier[field] operator[=] identifier[ClassUtil] operator[SEP] identifier[getDeclaredFieldSilent] operator[SEP] identifier[entity] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[fieldName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Reference] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[ClassUtil] operator[SEP] identifier[setSilent] operator[SEP] identifier[entity] , identifier[fieldName] , identifier[ProxyUtil] operator[SEP] identifier[createLazyProxy] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[daoSupport] , identifier[text] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Column] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Codec] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[Class] operator[<] operator[?] Keyword[extends] identifier[com] operator[SEP] identifier[apitrary] operator[SEP] identifier[orm] operator[SEP] identifier[core] operator[SEP] identifier[codec] operator[SEP] identifier[Codec] operator[>] identifier[codecClazz] operator[=] identifier[ClassUtil] operator[SEP] identifier[getFieldAnnotationValue] operator[SEP] literal[String] , identifier[field] , identifier[Codec] operator[SEP] Keyword[class] , identifier[Class] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[com] operator[SEP] identifier[apitrary] operator[SEP] identifier[orm] operator[SEP] identifier[core] operator[SEP] identifier[codec] operator[SEP] identifier[Codec] identifier[codec] operator[=] operator[SEP] identifier[com] operator[SEP] identifier[apitrary] operator[SEP] identifier[orm] operator[SEP] identifier[core] operator[SEP] identifier[codec] operator[SEP] identifier[Codec] operator[SEP] identifier[ClassUtil] operator[SEP] identifier[newInstance] operator[SEP] identifier[codecClazz] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[=] identifier[codec] operator[SEP] identifier[decode] operator[SEP] identifier[text] operator[SEP] operator[SEP] identifier[ClassUtil] operator[SEP] identifier[setSilent] operator[SEP] identifier[entity] , identifier[fieldName] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ClassUtil] operator[SEP] identifier[setSilent] operator[SEP] identifier[entity] , identifier[fieldName] , identifier[text] operator[SEP] operator[SEP]
}
}
}
}
}
|
public static <T> boolean containsNo(Collection<T> baseList, Collection<T> valueList) {
for (T v : valueList) {
if (baseList.contains(v)) {
return false;
}
}
return true;
} | class class_name[name] begin[{]
method[containsNo, return_type[type[boolean]], modifier[public static], parameter[baseList, valueList]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=baseList, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=valueList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[boolean] identifier[containsNo] operator[SEP] identifier[Collection] operator[<] identifier[T] operator[>] identifier[baseList] , identifier[Collection] operator[<] identifier[T] operator[>] identifier[valueList] operator[SEP] {
Keyword[for] operator[SEP] identifier[T] identifier[v] operator[:] identifier[valueList] operator[SEP] {
Keyword[if] operator[SEP] identifier[baseList] operator[SEP] identifier[contains] operator[SEP] identifier[v] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public void setTargetNormal( double nx, double ny, double nz )
{
double h,f,c,vx,vy,hvx;
vx = ny;
vy = -nx;
c = nz;
h = (1-c)/(1-c*c);
hvx = h*vx;
f = (c < 0) ? -c : c;
if( f < 1.0 - 1.0E-4 )
{
m00=c + hvx*vx;
m01=hvx*vy;
m02=-vy;
m10=hvx*vy;
m11=c + h*vy*vy;
m12=vx;
m20=vy;
m21=-vx;
m22=c;
}
else
{
// if "from" and "to" vectors are nearly parallel
m00=1;
m01=0;
m02=0;
m10=0;
m11=1;
m12=0;
m20=0;
m21=0;
if( c > 0 )
{
m22=1;
}
else
{
m22=-1;
}
}
} | class class_name[name] begin[{]
method[setTargetNormal, return_type[void], modifier[public], parameter[nx, ny, nz]] begin[{]
local_variable[type[double], h]
assign[member[.vx], member[.ny]]
assign[member[.vy], member[.nx]]
assign[member[.c], member[.nz]]
assign[member[.h], binary_operation[binary_operation[literal[1], -, member[.c]], /, binary_operation[literal[1], -, binary_operation[member[.c], *, member[.c]]]]]
assign[member[.hvx], binary_operation[member[.h], *, member[.vx]]]
assign[member[.f], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=c, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[]))]
if[binary_operation[member[.f], <, binary_operation[literal[1.0], -, literal[1.0E-4]]]] begin[{]
assign[member[.m00], binary_operation[member[.c], +, binary_operation[member[.hvx], *, member[.vx]]]]
assign[member[.m01], binary_operation[member[.hvx], *, member[.vy]]]
assign[member[.m02], member[.vy]]
assign[member[.m10], binary_operation[member[.hvx], *, member[.vy]]]
assign[member[.m11], binary_operation[member[.c], +, binary_operation[binary_operation[member[.h], *, member[.vy]], *, member[.vy]]]]
assign[member[.m12], member[.vx]]
assign[member[.m20], member[.vy]]
assign[member[.m21], member[.vx]]
assign[member[.m22], member[.c]]
else begin[{]
assign[member[.m00], literal[1]]
assign[member[.m01], literal[0]]
assign[member[.m02], literal[0]]
assign[member[.m10], literal[0]]
assign[member[.m11], literal[1]]
assign[member[.m12], literal[0]]
assign[member[.m20], literal[0]]
assign[member[.m21], literal[0]]
if[binary_operation[member[.c], >, literal[0]]] begin[{]
assign[member[.m22], literal[1]]
else begin[{]
assign[member[.m22], literal[1]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setTargetNormal] operator[SEP] Keyword[double] identifier[nx] , Keyword[double] identifier[ny] , Keyword[double] identifier[nz] operator[SEP] {
Keyword[double] identifier[h] , identifier[f] , identifier[c] , identifier[vx] , identifier[vy] , identifier[hvx] operator[SEP] identifier[vx] operator[=] identifier[ny] operator[SEP] identifier[vy] operator[=] operator[-] identifier[nx] operator[SEP] identifier[c] operator[=] identifier[nz] operator[SEP] identifier[h] operator[=] operator[SEP] Other[1] operator[-] identifier[c] operator[SEP] operator[/] operator[SEP] Other[1] operator[-] identifier[c] operator[*] identifier[c] operator[SEP] operator[SEP] identifier[hvx] operator[=] identifier[h] operator[*] identifier[vx] operator[SEP] identifier[f] operator[=] operator[SEP] identifier[c] operator[<] Other[0] operator[SEP] operator[?] operator[-] identifier[c] operator[:] identifier[c] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[<] literal[Float] operator[-] literal[Float] operator[SEP] {
identifier[m00] operator[=] identifier[c] operator[+] identifier[hvx] operator[*] identifier[vx] operator[SEP] identifier[m01] operator[=] identifier[hvx] operator[*] identifier[vy] operator[SEP] identifier[m02] operator[=] operator[-] identifier[vy] operator[SEP] identifier[m10] operator[=] identifier[hvx] operator[*] identifier[vy] operator[SEP] identifier[m11] operator[=] identifier[c] operator[+] identifier[h] operator[*] identifier[vy] operator[*] identifier[vy] operator[SEP] identifier[m12] operator[=] identifier[vx] operator[SEP] identifier[m20] operator[=] identifier[vy] operator[SEP] identifier[m21] operator[=] operator[-] identifier[vx] operator[SEP] identifier[m22] operator[=] identifier[c] operator[SEP]
}
Keyword[else] {
identifier[m00] operator[=] Other[1] operator[SEP] identifier[m01] operator[=] Other[0] operator[SEP] identifier[m02] operator[=] Other[0] operator[SEP] identifier[m10] operator[=] Other[0] operator[SEP] identifier[m11] operator[=] Other[1] operator[SEP] identifier[m12] operator[=] Other[0] operator[SEP] identifier[m20] operator[=] Other[0] operator[SEP] identifier[m21] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[>] Other[0] operator[SEP] {
identifier[m22] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[m22] operator[=] operator[-] Other[1] operator[SEP]
}
}
}
|
public static <I extends ImageGray<I>, D extends ImageGray<D>>
GeneralFeatureIntensity<I,D> median( int radius , Class<I> imageType ) {
BlurStorageFilter<I> filter = FactoryBlurFilter.median(ImageType.single(imageType),radius);
return new WrapperMedianCornerIntensity<>(filter);
} | class class_name[name] begin[{]
method[median, return_type[type[GeneralFeatureIntensity]], modifier[public static], parameter[radius, imageType]] begin[{]
local_variable[type[BlurStorageFilter], filter]
return[ClassCreator(arguments=[MemberReference(member=filter, 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=WrapperMedianCornerIntensity, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[I] Keyword[extends] identifier[ImageGray] operator[<] identifier[I] operator[>] , identifier[D] Keyword[extends] identifier[ImageGray] operator[<] identifier[D] operator[>] operator[>] identifier[GeneralFeatureIntensity] operator[<] identifier[I] , identifier[D] operator[>] identifier[median] operator[SEP] Keyword[int] identifier[radius] , identifier[Class] operator[<] identifier[I] operator[>] identifier[imageType] operator[SEP] {
identifier[BlurStorageFilter] operator[<] identifier[I] operator[>] identifier[filter] operator[=] identifier[FactoryBlurFilter] operator[SEP] identifier[median] operator[SEP] identifier[ImageType] operator[SEP] identifier[single] operator[SEP] identifier[imageType] operator[SEP] , identifier[radius] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[WrapperMedianCornerIntensity] operator[<] operator[>] operator[SEP] identifier[filter] operator[SEP] operator[SEP]
}
|
@HtmlSafe
public String getRenderedContent()
{
Page page = gpUtil.getPageManager().getPage(spaceKey, getPageTitle());
if (page == null) return gpUtil.getText("greenpepper.children.pagenotfound");
StringBuilder content = new StringBuilder("{greenpepper-historic:");
content.append(HistoricParameters.SPACEKEY).append("=").append(spaceKey)
.append("|").append(HistoricParameters.PAGETITLE).append("=").append(page.getTitle().trim())
.append("|").append(HistoricParameters.WIDTH).append("=").append(width)
.append("|").append(HistoricParameters.HEIGHT).append("=").append(height)
.append("|").append(HistoricParameters.SUT).append("=").append(sut)
.append("|").append(HistoricParameters.SHOWIGNORED).append("=").append(showIgnored)
.append("|").append(HistoricParameters.MAXRESULT).append("=").append(maxResult);
content.append("}");
// return gpUtil.getWikiStyleRenderer().convertWikiToXHtml(page.toPageContext(), content.toString());
return gpUtil.getViewRenderer().render(page);
} | class class_name[name] begin[{]
method[getRenderedContent, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[Page], page]
if[binary_operation[member[.page], ==, literal[null]]] begin[{]
return[call[gpUtil.getText, parameter[literal["greenpepper.children.pagenotfound"]]]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], content]
call[content.append, parameter[member[HistoricParameters.SPACEKEY]]]
call[content.append, parameter[literal["}"]]]
return[call[gpUtil.getViewRenderer, parameter[]]]
end[}]
END[}] | annotation[@] identifier[HtmlSafe] Keyword[public] identifier[String] identifier[getRenderedContent] operator[SEP] operator[SEP] {
identifier[Page] identifier[page] operator[=] identifier[gpUtil] operator[SEP] identifier[getPageManager] operator[SEP] operator[SEP] operator[SEP] identifier[getPage] operator[SEP] identifier[spaceKey] , identifier[getPageTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[page] operator[==] Other[null] operator[SEP] Keyword[return] identifier[gpUtil] operator[SEP] identifier[getText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[content] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[content] operator[SEP] identifier[append] operator[SEP] identifier[HistoricParameters] operator[SEP] identifier[SPACEKEY] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[spaceKey] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[HistoricParameters] operator[SEP] identifier[PAGETITLE] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[page] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[HistoricParameters] operator[SEP] identifier[WIDTH] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[width] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[HistoricParameters] operator[SEP] identifier[HEIGHT] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[height] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[HistoricParameters] operator[SEP] identifier[SUT] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[sut] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[HistoricParameters] operator[SEP] identifier[SHOWIGNORED] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[showIgnored] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[HistoricParameters] operator[SEP] identifier[MAXRESULT] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[maxResult] operator[SEP] operator[SEP] identifier[content] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[gpUtil] operator[SEP] identifier[getViewRenderer] operator[SEP] operator[SEP] operator[SEP] identifier[render] operator[SEP] identifier[page] operator[SEP] operator[SEP]
}
|
public void addReceiverAnnotationInfo(ExecutableElement method, List<AnnotationMirror> descList,
Content htmltree) {
addAnnotationInfo(0, method, descList, false, htmltree);
} | class class_name[name] begin[{]
method[addReceiverAnnotationInfo, return_type[void], modifier[public], parameter[method, descList, htmltree]] begin[{]
call[.addAnnotationInfo, parameter[literal[0], member[.method], member[.descList], literal[false], member[.htmltree]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addReceiverAnnotationInfo] operator[SEP] identifier[ExecutableElement] identifier[method] , identifier[List] operator[<] identifier[AnnotationMirror] operator[>] identifier[descList] , identifier[Content] identifier[htmltree] operator[SEP] {
identifier[addAnnotationInfo] operator[SEP] Other[0] , identifier[method] , identifier[descList] , literal[boolean] , identifier[htmltree] operator[SEP] operator[SEP]
}
|
private List<EdgeTraversal> getTopologicalSortedSchedule(Map<String, Long> estimatedRootEntries, Pattern pattern) {
List<EdgeTraversal> resultingSchedule = new ArrayList<EdgeTraversal>();
Map<String, Set<String>> remainingDependencies = getDependencies(pattern);
Set<PatternNode> visitedNodes = new HashSet<PatternNode>();
Set<PatternEdge> visitedEdges = new HashSet<PatternEdge>();
// Sort the possible root vertices in order of estimated size, since we want to start with a small vertex set.
List<OPair<Long, String>> rootWeights = new ArrayList<OPair<Long, String>>();
for (Map.Entry<String, Long> root : estimatedRootEntries.entrySet()) {
rootWeights.add(new OPair<Long, String>(root.getValue(), root.getKey()));
}
Collections.sort(rootWeights);
// Add the starting vertices, in the correct order, to an ordered set.
Set<String> remainingStarts = new LinkedHashSet<String>();
for (OPair<Long, String> item : rootWeights) {
remainingStarts.add(item.getValue());
}
// Add all the remaining aliases after all the suggested start points.
for (String alias : pattern.aliasToNode.keySet()) {
if (!remainingStarts.contains(alias)) {
remainingStarts.add(alias);
}
}
while (resultingSchedule.size() < pattern.numOfEdges) {
// Start a new depth-first pass, adding all nodes with satisfied dependencies.
// 1. Find a starting vertex for the depth-first pass.
PatternNode startingNode = null;
List<String> startsToRemove = new ArrayList<String>();
for (String currentAlias : remainingStarts) {
PatternNode currentNode = pattern.aliasToNode.get(currentAlias);
if (visitedNodes.contains(currentNode)) {
// If a previous traversal already visited this alias, remove it from further consideration.
startsToRemove.add(currentAlias);
} else if (remainingDependencies.get(currentAlias).isEmpty()) {
// If it hasn't been visited, and has all dependencies satisfied, visit it.
startsToRemove.add(currentAlias);
startingNode = currentNode;
break;
}
}
remainingStarts.removeAll(startsToRemove);
if (startingNode == null) {
// We didn't manage to find a valid root, and yet we haven't constructed a complete schedule.
// This means there must be a cycle in our dependency graph, or all dependency-free nodes are optional.
// Therefore, the query is invalid.
throw new OCommandExecutionException("This query contains MATCH conditions that cannot be evaluated, "
+ "like an undefined alias or a circular dependency on a $matched condition.");
}
// 2. Having found a starting vertex, traverse its neighbors depth-first,
// adding any non-visited ones with satisfied dependencies to our schedule.
updateScheduleStartingAt(startingNode, visitedNodes, visitedEdges, remainingDependencies, resultingSchedule);
}
if (resultingSchedule.size() != pattern.numOfEdges) {
throw new AssertionError("Incorrect number of edges: " + resultingSchedule.size() + " vs " + pattern.numOfEdges);
}
return resultingSchedule;
} | class class_name[name] begin[{]
method[getTopologicalSortedSchedule, return_type[type[List]], modifier[private], parameter[estimatedRootEntries, pattern]] begin[{]
local_variable[type[List], resultingSchedule]
local_variable[type[Map], remainingDependencies]
local_variable[type[Set], visitedNodes]
local_variable[type[Set], visitedEdges]
local_variable[type[List], rootWeights]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None)], 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=Long, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=OPair, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=rootWeights, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=estimatedRootEntries, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
call[Collections.sort, parameter[member[.rootWeights]]]
local_variable[type[Set], remainingStarts]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=remainingStarts, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=rootWeights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=OPair, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=alias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=remainingStarts, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=alias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=remainingStarts, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=pattern.aliasToNode, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=alias)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
while[binary_operation[call[resultingSchedule.size, parameter[]], <, member[pattern.numOfEdges]]] begin[{]
local_variable[type[PatternNode], startingNode]
local_variable[type[List], startsToRemove]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentAlias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=pattern.aliasToNode, selectors=[], type_arguments=None), name=currentNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PatternNode, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=currentNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=visitedNodes, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=currentAlias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=remainingDependencies, selectors=[MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentAlias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=startsToRemove, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=startingNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=currentNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentAlias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=startsToRemove, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=remainingStarts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=currentAlias)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[remainingStarts.removeAll, parameter[member[.startsToRemove]]]
if[binary_operation[member[.startingNode], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This query contains MATCH conditions that cannot be evaluated, "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="like an undefined alias or a circular dependency on a $matched condition."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OCommandExecutionException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.updateScheduleStartingAt, parameter[member[.startingNode], member[.visitedNodes], member[.visitedEdges], member[.remainingDependencies], member[.resultingSchedule]]]
end[}]
if[binary_operation[call[resultingSchedule.size, parameter[]], !=, member[pattern.numOfEdges]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Incorrect number of edges: "), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=resultingSchedule, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" vs "), operator=+), operandr=MemberReference(member=numOfEdges, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AssertionError, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.resultingSchedule]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[EdgeTraversal] operator[>] identifier[getTopologicalSortedSchedule] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Long] operator[>] identifier[estimatedRootEntries] , identifier[Pattern] identifier[pattern] operator[SEP] {
identifier[List] operator[<] identifier[EdgeTraversal] operator[>] identifier[resultingSchedule] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[EdgeTraversal] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[remainingDependencies] operator[=] identifier[getDependencies] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[PatternNode] operator[>] identifier[visitedNodes] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[PatternNode] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[PatternEdge] operator[>] identifier[visitedEdges] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[PatternEdge] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[OPair] operator[<] identifier[Long] , identifier[String] operator[>] operator[>] identifier[rootWeights] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[OPair] operator[<] identifier[Long] , identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Long] operator[>] identifier[root] operator[:] identifier[estimatedRootEntries] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[rootWeights] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[OPair] operator[<] identifier[Long] , identifier[String] operator[>] operator[SEP] identifier[root] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[root] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[rootWeights] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[remainingStarts] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[OPair] operator[<] identifier[Long] , identifier[String] operator[>] identifier[item] operator[:] identifier[rootWeights] operator[SEP] {
identifier[remainingStarts] operator[SEP] identifier[add] operator[SEP] identifier[item] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[alias] operator[:] identifier[pattern] operator[SEP] identifier[aliasToNode] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[remainingStarts] operator[SEP] identifier[contains] operator[SEP] identifier[alias] operator[SEP] operator[SEP] {
identifier[remainingStarts] operator[SEP] identifier[add] operator[SEP] identifier[alias] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] identifier[resultingSchedule] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[pattern] operator[SEP] identifier[numOfEdges] operator[SEP] {
identifier[PatternNode] identifier[startingNode] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[startsToRemove] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[currentAlias] operator[:] identifier[remainingStarts] operator[SEP] {
identifier[PatternNode] identifier[currentNode] operator[=] identifier[pattern] operator[SEP] identifier[aliasToNode] operator[SEP] identifier[get] operator[SEP] identifier[currentAlias] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[visitedNodes] operator[SEP] identifier[contains] operator[SEP] identifier[currentNode] operator[SEP] operator[SEP] {
identifier[startsToRemove] operator[SEP] identifier[add] operator[SEP] identifier[currentAlias] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[remainingDependencies] operator[SEP] identifier[get] operator[SEP] identifier[currentAlias] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[startsToRemove] operator[SEP] identifier[add] operator[SEP] identifier[currentAlias] operator[SEP] operator[SEP] identifier[startingNode] operator[=] identifier[currentNode] operator[SEP] Keyword[break] operator[SEP]
}
}
identifier[remainingStarts] operator[SEP] identifier[removeAll] operator[SEP] identifier[startsToRemove] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startingNode] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[OCommandExecutionException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[updateScheduleStartingAt] operator[SEP] identifier[startingNode] , identifier[visitedNodes] , identifier[visitedEdges] , identifier[remainingDependencies] , identifier[resultingSchedule] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[resultingSchedule] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[pattern] operator[SEP] identifier[numOfEdges] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] literal[String] operator[+] identifier[resultingSchedule] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[pattern] operator[SEP] identifier[numOfEdges] operator[SEP] operator[SEP]
}
Keyword[return] identifier[resultingSchedule] operator[SEP]
}
|
public static <T> Set<T> wrapSet(final T... source) {
val list = new LinkedHashSet<T>();
addToCollection(list, source);
return list;
} | class class_name[name] begin[{]
method[wrapSet, return_type[type[Set]], modifier[public static], parameter[source]] begin[{]
local_variable[type[val], list]
call[.addToCollection, parameter[member[.list], member[.source]]]
return[member[.list]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Set] operator[<] identifier[T] operator[>] identifier[wrapSet] operator[SEP] Keyword[final] identifier[T] operator[...] identifier[source] operator[SEP] {
identifier[val] identifier[list] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addToCollection] operator[SEP] identifier[list] , identifier[source] operator[SEP] operator[SEP] Keyword[return] identifier[list] operator[SEP]
}
|
private UnconditionalValueDerefSet duplicateFact(UnconditionalValueDerefSet fact) {
UnconditionalValueDerefSet copyOfFact = createFact();
copy(fact, copyOfFact);
fact = copyOfFact;
return fact;
} | class class_name[name] begin[{]
method[duplicateFact, return_type[type[UnconditionalValueDerefSet]], modifier[private], parameter[fact]] begin[{]
local_variable[type[UnconditionalValueDerefSet], copyOfFact]
call[.copy, parameter[member[.fact], member[.copyOfFact]]]
assign[member[.fact], member[.copyOfFact]]
return[member[.fact]]
end[}]
END[}] | Keyword[private] identifier[UnconditionalValueDerefSet] identifier[duplicateFact] operator[SEP] identifier[UnconditionalValueDerefSet] identifier[fact] operator[SEP] {
identifier[UnconditionalValueDerefSet] identifier[copyOfFact] operator[=] identifier[createFact] operator[SEP] operator[SEP] operator[SEP] identifier[copy] operator[SEP] identifier[fact] , identifier[copyOfFact] operator[SEP] operator[SEP] identifier[fact] operator[=] identifier[copyOfFact] operator[SEP] Keyword[return] identifier[fact] operator[SEP]
}
|
public DeviceAttribute[] read_attribute(final DeviceProxy deviceProxy, final String[] attributeNames)
throws DevFailed {
DeviceAttribute[] attr;
build_connection(deviceProxy);
// Read attributes on device server
AttributeValue[] attributeValues = new AttributeValue[0];
AttributeValue_3[] attributeValues_3 = new AttributeValue_3[0];
AttributeValue_4[] attributeValues_4 = new AttributeValue_4[0];
AttributeValue_5[] attributeValues_5 = new AttributeValue_5[0];
if (deviceProxy.url.protocol == TANGO) {
// try 2 times for reconnection if requested
boolean done = false;
final int retries = deviceProxy.transparent_reconnection ? 2 : 1;
for (int i = 0; i < retries && !done; i++) {
try {
if (deviceProxy.device_5 != null) {
attributeValues_5 = deviceProxy.device_5.read_attributes_5(
attributeNames, deviceProxy.dev_src,
DevLockManager.getInstance().getClntIdent());
}
else if (deviceProxy.device_4 != null) {
attributeValues_4 = deviceProxy.device_4.read_attributes_4(
attributeNames, deviceProxy.dev_src,
DevLockManager.getInstance().getClntIdent());
}
else if (deviceProxy.device_3 != null) {
attributeValues_3 = deviceProxy.device_3.read_attributes_3(
attributeNames, deviceProxy.dev_src);
}
else if (deviceProxy.device_2 != null) {
attributeValues = deviceProxy.device_2.read_attributes_2(
attributeNames, deviceProxy.dev_src);
}
else {
attributeValues = deviceProxy.device.read_attributes(attributeNames);
}
done = true;
} catch (final DevFailed e) {
// Except.print_exception(e);
final StringBuilder sb = new StringBuilder(attributeNames[0]);
for (int j = 1; j < attributeNames.length; j++) {
sb.append(", ").append(attributeNames[j]);
}
Except.throw_connection_failed(e, "TangoApi_CANNOT_READ_ATTRIBUTE",
"Cannot read attribute(s): " + sb.toString(),
deviceProxy.getFull_class_name() + ".read_attribute()");
} catch (final Exception e) {
manageExceptionReconnection(deviceProxy,
retries, i, e, this.getClass() + ".read_attribute");
}
}
// Build a Device Attribute Object
// Depends on Device_impl version
if (deviceProxy.device_5 != null) {
attr = new DeviceAttribute[attributeValues_5.length];
for (int i = 0; i < attributeValues_5.length; i++) {
attr[i] = new DeviceAttribute(attributeValues_5[i]);
}
} else if (deviceProxy.device_4 != null) {
attr = new DeviceAttribute[attributeValues_4.length];
for (int i = 0; i < attributeValues_4.length; i++) {
attr[i] = new DeviceAttribute(attributeValues_4[i]);
}
} else if (deviceProxy.device_3 != null) {
attr = new DeviceAttribute[attributeValues_3.length];
for (int i = 0; i < attributeValues_3.length; i++) {
attr[i] = new DeviceAttribute(attributeValues_3[i]);
}
} else {
attr = new DeviceAttribute[attributeValues.length];
for (int i = 0; i < attributeValues.length; i++) {
attr[i] = new DeviceAttribute(attributeValues[i]);
}
}
} else {
attr = deviceProxy.taco_device.read_attribute(attributeNames);
}
return attr;
} | class class_name[name] begin[{]
method[read_attribute, return_type[type[DeviceAttribute]], modifier[public], parameter[deviceProxy, attributeNames]] begin[{]
local_variable[type[DeviceAttribute], attr]
call[.build_connection, parameter[member[.deviceProxy]]]
local_variable[type[AttributeValue], attributeValues]
local_variable[type[AttributeValue_3], attributeValues_3]
local_variable[type[AttributeValue_4], attributeValues_4]
local_variable[type[AttributeValue_5], attributeValues_5]
if[binary_operation[member[deviceProxy.url.protocol], ==, member[.TANGO]]] begin[{]
local_variable[type[boolean], done]
local_variable[type[int], retries]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=device_5, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=device_4, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=device_3, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=device_2, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attributeValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read_attributes, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.device, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attributeValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dev_src, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[])], member=read_attributes_2, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.device_2, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attributeValues_3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dev_src, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[])], member=read_attributes_3, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.device_3, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attributeValues_4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dev_src, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[]), MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=DevLockManager, selectors=[MethodInvocation(arguments=[], member=getClntIdent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=read_attributes_4, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.device_4, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attributeValues_5, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dev_src, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[]), MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=DevLockManager, selectors=[MethodInvocation(arguments=[], member=getClntIdent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=read_attributes_5, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.device_5, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=done, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=attributeNames, 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=StringBuilder, sub_type=None)), name=sb)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[MemberReference(member=attributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=attributeNames, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TangoApi_CANNOT_READ_ATTRIBUTE"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot read attribute(s): "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), operator=+), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFull_class_name, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".read_attribute()"), operator=+)], member=throw_connection_failed, postfix_operators=[], prefix_operators=[], qualifier=Except, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DevFailed'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=deviceProxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=retries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".read_attribute"), operator=+)], member=manageExceptionReconnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=retries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=MemberReference(member=done, 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)
if[binary_operation[member[deviceProxy.device_5], !=, literal[null]]] begin[{]
assign[member[.attr], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=attributeValues_5, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DeviceAttribute, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=attributeValues_5, 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=DeviceAttribute, sub_type=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=attributeValues_5, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
if[binary_operation[member[deviceProxy.device_4], !=, literal[null]]] begin[{]
assign[member[.attr], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=attributeValues_4, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DeviceAttribute, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=attributeValues_4, 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=DeviceAttribute, sub_type=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=attributeValues_4, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
if[binary_operation[member[deviceProxy.device_3], !=, literal[null]]] begin[{]
assign[member[.attr], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=attributeValues_3, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DeviceAttribute, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=attributeValues_3, 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=DeviceAttribute, sub_type=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=attributeValues_3, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
assign[member[.attr], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=attributeValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DeviceAttribute, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=attributeValues, 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=DeviceAttribute, sub_type=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=attributeValues, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
end[}]
end[}]
else begin[{]
assign[member[.attr], call[deviceProxy.taco_device.read_attribute, parameter[member[.attributeNames]]]]
end[}]
return[member[.attr]]
end[}]
END[}] | Keyword[public] identifier[DeviceAttribute] operator[SEP] operator[SEP] identifier[read_attribute] operator[SEP] Keyword[final] identifier[DeviceProxy] identifier[deviceProxy] , Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[attributeNames] operator[SEP] Keyword[throws] identifier[DevFailed] {
identifier[DeviceAttribute] operator[SEP] operator[SEP] identifier[attr] operator[SEP] identifier[build_connection] operator[SEP] identifier[deviceProxy] operator[SEP] operator[SEP] identifier[AttributeValue] operator[SEP] operator[SEP] identifier[attributeValues] operator[=] Keyword[new] identifier[AttributeValue] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[AttributeValue_3] operator[SEP] operator[SEP] identifier[attributeValues_3] operator[=] Keyword[new] identifier[AttributeValue_3] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[AttributeValue_4] operator[SEP] operator[SEP] identifier[attributeValues_4] operator[=] Keyword[new] identifier[AttributeValue_4] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[AttributeValue_5] operator[SEP] operator[SEP] identifier[attributeValues_5] operator[=] Keyword[new] identifier[AttributeValue_5] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[url] operator[SEP] identifier[protocol] operator[==] identifier[TANGO] operator[SEP] {
Keyword[boolean] identifier[done] operator[=] literal[boolean] operator[SEP] Keyword[final] Keyword[int] identifier[retries] operator[=] identifier[deviceProxy] operator[SEP] identifier[transparent_reconnection] operator[?] Other[2] operator[:] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[retries] operator[&&] operator[!] identifier[done] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_5] operator[!=] Other[null] operator[SEP] {
identifier[attributeValues_5] operator[=] identifier[deviceProxy] operator[SEP] identifier[device_5] operator[SEP] identifier[read_attributes_5] operator[SEP] identifier[attributeNames] , identifier[deviceProxy] operator[SEP] identifier[dev_src] , identifier[DevLockManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getClntIdent] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_4] operator[!=] Other[null] operator[SEP] {
identifier[attributeValues_4] operator[=] identifier[deviceProxy] operator[SEP] identifier[device_4] operator[SEP] identifier[read_attributes_4] operator[SEP] identifier[attributeNames] , identifier[deviceProxy] operator[SEP] identifier[dev_src] , identifier[DevLockManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getClntIdent] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_3] operator[!=] Other[null] operator[SEP] {
identifier[attributeValues_3] operator[=] identifier[deviceProxy] operator[SEP] identifier[device_3] operator[SEP] identifier[read_attributes_3] operator[SEP] identifier[attributeNames] , identifier[deviceProxy] operator[SEP] identifier[dev_src] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_2] operator[!=] Other[null] operator[SEP] {
identifier[attributeValues] operator[=] identifier[deviceProxy] operator[SEP] identifier[device_2] operator[SEP] identifier[read_attributes_2] operator[SEP] identifier[attributeNames] , identifier[deviceProxy] operator[SEP] identifier[dev_src] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[attributeValues] operator[=] identifier[deviceProxy] operator[SEP] identifier[device] operator[SEP] identifier[read_attributes] operator[SEP] identifier[attributeNames] operator[SEP] operator[SEP]
}
identifier[done] operator[=] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[DevFailed] identifier[e] operator[SEP] {
Keyword[final] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[attributeNames] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[1] operator[SEP] identifier[j] operator[<] identifier[attributeNames] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[attributeNames] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Except] operator[SEP] identifier[throw_connection_failed] operator[SEP] identifier[e] , literal[String] , literal[String] operator[+] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[deviceProxy] operator[SEP] identifier[getFull_class_name] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] {
identifier[manageExceptionReconnection] operator[SEP] identifier[deviceProxy] , identifier[retries] , identifier[i] , identifier[e] , Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_5] operator[!=] Other[null] operator[SEP] {
identifier[attr] operator[=] Keyword[new] identifier[DeviceAttribute] operator[SEP] identifier[attributeValues_5] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[attributeValues_5] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[attr] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[DeviceAttribute] operator[SEP] identifier[attributeValues_5] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_4] operator[!=] Other[null] operator[SEP] {
identifier[attr] operator[=] Keyword[new] identifier[DeviceAttribute] operator[SEP] identifier[attributeValues_4] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[attributeValues_4] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[attr] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[DeviceAttribute] operator[SEP] identifier[attributeValues_4] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_3] operator[!=] Other[null] operator[SEP] {
identifier[attr] operator[=] Keyword[new] identifier[DeviceAttribute] operator[SEP] identifier[attributeValues_3] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[attributeValues_3] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[attr] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[DeviceAttribute] operator[SEP] identifier[attributeValues_3] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[attr] operator[=] Keyword[new] identifier[DeviceAttribute] operator[SEP] identifier[attributeValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[attributeValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[attr] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[DeviceAttribute] operator[SEP] identifier[attributeValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[attr] operator[=] identifier[deviceProxy] operator[SEP] identifier[taco_device] operator[SEP] identifier[read_attribute] operator[SEP] identifier[attributeNames] operator[SEP] operator[SEP]
}
Keyword[return] identifier[attr] operator[SEP]
}
|
public void refreshSchemataCache()
{
try {
final List<GoodwillSchema> schemata = delegate.getSchemata().get();
// If Goodwill is down - keep the old cache around
if (schemata == null) {
return;
}
final Map<String,GoodwillSchema> newSchemataCache = new ConcurrentHashMap<String, GoodwillSchema>();
for (final GoodwillSchema schema : schemata) {
newSchemataCache.put(schema.getName(), schema);
}
synchronized (cacheMonitor) {
knownSchemata.clear();
knownSchemata.putAll(newSchemataCache);
}
}
catch (InterruptedException e) {
log.warn("Interrupted while refreshing the cache");
Thread.currentThread().interrupt();
}
catch (ExecutionException e) {
log.warn("Unable to refresh schemata cache: {}", e.getLocalizedMessage());
}
} | class class_name[name] begin[{]
method[refreshSchemataCache, return_type[void], modifier[public], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSchemata, postfix_operators=[], prefix_operators=[], qualifier=delegate, selectors=[MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=schemata)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=GoodwillSchema, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=schemata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=GoodwillSchema, sub_type=None))], dimensions=None, name=ConcurrentHashMap, sub_type=None)), name=newSchemataCache)], modifiers={'final'}, 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=GoodwillSchema, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=schema, selectors=[], type_arguments=None), MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=newSchemataCache, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=schemata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=schema)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=GoodwillSchema, sub_type=None))), label=None), SynchronizedStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=knownSchemata, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newSchemataCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=knownSchemata, selectors=[], type_arguments=None), label=None)], label=None, lock=MemberReference(member=cacheMonitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Interrupted while refreshing the cache")], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to refresh schemata cache: {}"), MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ExecutionException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[refreshSchemataCache] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[final] identifier[List] operator[<] identifier[GoodwillSchema] operator[>] identifier[schemata] operator[=] identifier[delegate] operator[SEP] identifier[getSchemata] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[schemata] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[GoodwillSchema] operator[>] identifier[newSchemataCache] operator[=] Keyword[new] identifier[ConcurrentHashMap] operator[<] identifier[String] , identifier[GoodwillSchema] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[GoodwillSchema] identifier[schema] operator[:] identifier[schemata] operator[SEP] {
identifier[newSchemataCache] operator[SEP] identifier[put] operator[SEP] identifier[schema] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[schema] operator[SEP] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[cacheMonitor] operator[SEP] {
identifier[knownSchemata] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[knownSchemata] operator[SEP] identifier[putAll] operator[SEP] identifier[newSchemataCache] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ExecutionException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Nonnull
public static QCryptoBlockInfo qcow(@Nonnull QCryptoBlockInfoQCow qcow) {
QCryptoBlockInfo self = new QCryptoBlockInfo();
self.format = QCryptoBlockFormat.qcow;
self.qcow = qcow;
return self;
} | class class_name[name] begin[{]
method[qcow, return_type[type[QCryptoBlockInfo]], modifier[public static], parameter[qcow]] begin[{]
local_variable[type[QCryptoBlockInfo], self]
assign[member[self.format], member[QCryptoBlockFormat.qcow]]
assign[member[self.qcow], member[.qcow]]
return[member[.self]]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[QCryptoBlockInfo] identifier[qcow] operator[SEP] annotation[@] identifier[Nonnull] identifier[QCryptoBlockInfoQCow] identifier[qcow] operator[SEP] {
identifier[QCryptoBlockInfo] identifier[self] operator[=] Keyword[new] identifier[QCryptoBlockInfo] operator[SEP] operator[SEP] operator[SEP] identifier[self] operator[SEP] identifier[format] operator[=] identifier[QCryptoBlockFormat] operator[SEP] identifier[qcow] operator[SEP] identifier[self] operator[SEP] identifier[qcow] operator[=] identifier[qcow] operator[SEP] Keyword[return] identifier[self] operator[SEP]
}
|
public void addRemoveProduct(String source, String name, String value, boolean regex, Confidence confidence) {
removeProduct.add(new EvidenceMatcher(source, name, value, regex, confidence));
} | class class_name[name] begin[{]
method[addRemoveProduct, return_type[void], modifier[public], parameter[source, name, value, regex, confidence]] begin[{]
call[removeProduct.add, parameter[ClassCreator(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=regex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=confidence, 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=EvidenceMatcher, sub_type=None))]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addRemoveProduct] operator[SEP] identifier[String] identifier[source] , identifier[String] identifier[name] , identifier[String] identifier[value] , Keyword[boolean] identifier[regex] , identifier[Confidence] identifier[confidence] operator[SEP] {
identifier[removeProduct] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[EvidenceMatcher] operator[SEP] identifier[source] , identifier[name] , identifier[value] , identifier[regex] , identifier[confidence] operator[SEP] operator[SEP] operator[SEP]
}
|
private AbstractPlanNode handleUnionLimitOperator(AbstractPlanNode root) {
// The coordinator's top limit graph fragment for a MP plan.
// If planning "order by ... limit", getNextUnionPlan()
// will have already added an order by to the coordinator frag.
// This is the only limit node in a SP plan
LimitPlanNode topLimit = m_parsedUnion.getLimitNodeTop();
assert(topLimit != null);
return inlineLimitOperator(root, topLimit);
} | class class_name[name] begin[{]
method[handleUnionLimitOperator, return_type[type[AbstractPlanNode]], modifier[private], parameter[root]] begin[{]
local_variable[type[LimitPlanNode], topLimit]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=topLimit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
return[call[.inlineLimitOperator, parameter[member[.root], member[.topLimit]]]]
end[}]
END[}] | Keyword[private] identifier[AbstractPlanNode] identifier[handleUnionLimitOperator] operator[SEP] identifier[AbstractPlanNode] identifier[root] operator[SEP] {
identifier[LimitPlanNode] identifier[topLimit] operator[=] identifier[m_parsedUnion] operator[SEP] identifier[getLimitNodeTop] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[topLimit] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[inlineLimitOperator] operator[SEP] identifier[root] , identifier[topLimit] operator[SEP] operator[SEP]
}
|
public static int strToDate(String dateStr, String fromFormat) {
// It is OK to use UTC, we just want get the epoch days
// TODO use offset, better performance
long ts = parseToTimeMillis(dateStr, fromFormat, TimeZone.getTimeZone("UTC"));
ZoneId zoneId = ZoneId.of("UTC");
Instant instant = Instant.ofEpochMilli(ts);
ZonedDateTime zdt = ZonedDateTime.ofInstant(instant, zoneId);
return DateTimeUtils.ymdToUnixDate(zdt.getYear(), zdt.getMonthValue(), zdt.getDayOfMonth());
} | class class_name[name] begin[{]
method[strToDate, return_type[type[int]], modifier[public static], parameter[dateStr, fromFormat]] begin[{]
local_variable[type[long], ts]
local_variable[type[ZoneId], zoneId]
local_variable[type[Instant], instant]
local_variable[type[ZonedDateTime], zdt]
return[call[DateTimeUtils.ymdToUnixDate, parameter[call[zdt.getYear, parameter[]], call[zdt.getMonthValue, parameter[]], call[zdt.getDayOfMonth, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[strToDate] operator[SEP] identifier[String] identifier[dateStr] , identifier[String] identifier[fromFormat] operator[SEP] {
Keyword[long] identifier[ts] operator[=] identifier[parseToTimeMillis] operator[SEP] identifier[dateStr] , identifier[fromFormat] , identifier[TimeZone] operator[SEP] identifier[getTimeZone] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ZoneId] identifier[zoneId] operator[=] identifier[ZoneId] operator[SEP] identifier[of] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Instant] identifier[instant] operator[=] identifier[Instant] operator[SEP] identifier[ofEpochMilli] operator[SEP] identifier[ts] operator[SEP] operator[SEP] identifier[ZonedDateTime] identifier[zdt] operator[=] identifier[ZonedDateTime] operator[SEP] identifier[ofInstant] operator[SEP] identifier[instant] , identifier[zoneId] operator[SEP] operator[SEP] Keyword[return] identifier[DateTimeUtils] operator[SEP] identifier[ymdToUnixDate] operator[SEP] identifier[zdt] operator[SEP] identifier[getYear] operator[SEP] operator[SEP] , identifier[zdt] operator[SEP] identifier[getMonthValue] operator[SEP] operator[SEP] , identifier[zdt] operator[SEP] identifier[getDayOfMonth] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> cacheWithInitialCapacity(int initialCapacity) {
ObjectHelper.verifyPositive(initialCapacity, "initialCapacity");
return RxJavaPlugins.onAssembly(new FlowableCache<T>(this, initialCapacity));
} | class class_name[name] begin[{]
method[cacheWithInitialCapacity, return_type[type[Flowable]], modifier[final public], parameter[initialCapacity]] begin[{]
call[ObjectHelper.verifyPositive, parameter[member[.initialCapacity], literal["initialCapacity"]]]
return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=initialCapacity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=FlowableCache, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[CheckReturnValue] annotation[@] identifier[BackpressureSupport] operator[SEP] identifier[BackpressureKind] operator[SEP] identifier[FULL] operator[SEP] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[final] identifier[Flowable] operator[<] identifier[T] operator[>] identifier[cacheWithInitialCapacity] operator[SEP] Keyword[int] identifier[initialCapacity] operator[SEP] {
identifier[ObjectHelper] operator[SEP] identifier[verifyPositive] operator[SEP] identifier[initialCapacity] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[FlowableCache] operator[<] identifier[T] operator[>] operator[SEP] Keyword[this] , identifier[initialCapacity] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean hasDecompBoundary(int c, boolean before) {
for(;;) {
if(c<minDecompNoCP) {
return true;
}
int norm16=getNorm16(c);
if(isHangul(norm16) || isDecompYesAndZeroCC(norm16)) {
return true;
} else if(norm16>MIN_NORMAL_MAYBE_YES) {
return false; // ccc!=0
} else if(isDecompNoAlgorithmic(norm16)) {
c=mapAlgorithmic(c, norm16);
} else {
// c decomposes, get everything from the variable-length extra data
int firstUnit=extraData.charAt(norm16);
if((firstUnit&MAPPING_LENGTH_MASK)==0) {
return false;
}
if(!before) {
// decomp after-boundary: same as hasFCDBoundaryAfter(),
// fcd16<=1 || trailCC==0
if(firstUnit>0x1ff) {
return false; // trailCC>1
}
if(firstUnit<=0xff) {
return true; // trailCC==0
}
// if(trailCC==1) test leadCC==0, same as checking for before-boundary
}
// true if leadCC==0 (hasFCDBoundaryBefore())
return (firstUnit&MAPPING_HAS_CCC_LCCC_WORD)==0 || (extraData.charAt(norm16-1)&0xff00)==0;
}
}
} | class class_name[name] begin[{]
method[hasDecompBoundary, return_type[type[boolean]], modifier[public], parameter[c, before]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=minDecompNoCP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNorm16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=norm16)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=norm16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isHangul, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=norm16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDecompYesAndZeroCC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=norm16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MIN_NORMAL_MAYBE_YES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=norm16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDecompNoAlgorithmic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=norm16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=extraData, selectors=[], type_arguments=None), name=firstUnit)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=firstUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAPPING_LENGTH_MASK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), IfStatement(condition=MemberReference(member=before, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=firstUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x1ff), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=firstUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))])), ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=firstUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAPPING_HAS_CCC_LCCC_WORD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=norm16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=extraData, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff00), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=norm16, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mapAlgorithmic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=ForControl(condition=None, init=None, update=None), label=None)
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[hasDecompBoundary] operator[SEP] Keyword[int] identifier[c] , Keyword[boolean] identifier[before] operator[SEP] {
Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] operator[<] identifier[minDecompNoCP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[int] identifier[norm16] operator[=] identifier[getNorm16] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isHangul] operator[SEP] identifier[norm16] operator[SEP] operator[||] identifier[isDecompYesAndZeroCC] operator[SEP] identifier[norm16] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[norm16] operator[>] identifier[MIN_NORMAL_MAYBE_YES] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[isDecompNoAlgorithmic] operator[SEP] identifier[norm16] operator[SEP] operator[SEP] {
identifier[c] operator[=] identifier[mapAlgorithmic] operator[SEP] identifier[c] , identifier[norm16] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[int] identifier[firstUnit] operator[=] identifier[extraData] operator[SEP] identifier[charAt] operator[SEP] identifier[norm16] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[firstUnit] operator[&] identifier[MAPPING_LENGTH_MASK] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[before] operator[SEP] {
Keyword[if] operator[SEP] identifier[firstUnit] operator[>] literal[Integer] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[firstUnit] operator[<=] literal[Integer] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] operator[SEP] identifier[firstUnit] operator[&] identifier[MAPPING_HAS_CCC_LCCC_WORD] operator[SEP] operator[==] Other[0] operator[||] operator[SEP] identifier[extraData] operator[SEP] identifier[charAt] operator[SEP] identifier[norm16] operator[-] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[==] Other[0] operator[SEP]
}
}
}
|
public synchronized Throwable initCause(Throwable cause) {
if ((this.containedException == null) && (cause != null)) {
throw new IllegalStateException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_OVERWRITE_CAUSE, null)); //"Can't overwrite cause");
}
if (cause == this) {
throw new IllegalArgumentException(
XMLMessages.createXMLMessage(XMLErrorResources.ER_SELF_CAUSATION_NOT_PERMITTED, null)); //"Self-causation not permitted");
}
this.containedException = cause;
return this;
} | class class_name[name] begin[{]
method[initCause, return_type[type[Throwable]], modifier[synchronized public], parameter[cause]] begin[{]
if[binary_operation[binary_operation[THIS[member[None.containedException]], ==, literal[null]], &&, binary_operation[member[.cause], !=, literal[null]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=ER_CANNOT_OVERWRITE_CAUSE, postfix_operators=[], prefix_operators=[], qualifier=XMLErrorResources, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=createXMLMessage, postfix_operators=[], prefix_operators=[], qualifier=XMLMessages, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.cause], ==, THIS[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=ER_SELF_CAUSATION_NOT_PERMITTED, postfix_operators=[], prefix_operators=[], qualifier=XMLErrorResources, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=createXMLMessage, postfix_operators=[], prefix_operators=[], qualifier=XMLMessages, selectors=[], type_arguments=None)], 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[THIS[member[None.containedException]], member[.cause]]
return[THIS[]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] identifier[Throwable] identifier[initCause] operator[SEP] identifier[Throwable] identifier[cause] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[containedException] operator[==] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[cause] operator[!=] Other[null] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[XMLMessages] operator[SEP] identifier[createXMLMessage] operator[SEP] identifier[XMLErrorResources] operator[SEP] identifier[ER_CANNOT_OVERWRITE_CAUSE] , Other[null] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[cause] operator[==] Keyword[this] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[XMLMessages] operator[SEP] identifier[createXMLMessage] operator[SEP] identifier[XMLErrorResources] operator[SEP] identifier[ER_SELF_CAUSATION_NOT_PERMITTED] , Other[null] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[containedException] operator[=] identifier[cause] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public final byte[] doFinal() throws IllegalStateException {
chooseFirstProvider();
if (initialized == false) {
throw new IllegalStateException("MAC not initialized");
}
byte[] mac = spi.engineDoFinal();
spi.engineReset();
return mac;
} | class class_name[name] begin[{]
method[doFinal, return_type[type[byte]], modifier[final public], parameter[]] begin[{]
call[.chooseFirstProvider, parameter[]]
if[binary_operation[member[.initialized], ==, literal[false]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MAC not initialized")], 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[}]
local_variable[type[byte], mac]
call[spi.engineReset, parameter[]]
return[member[.mac]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[doFinal] operator[SEP] operator[SEP] Keyword[throws] identifier[IllegalStateException] {
identifier[chooseFirstProvider] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[initialized] operator[==] literal[boolean] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[byte] operator[SEP] operator[SEP] identifier[mac] operator[=] identifier[spi] operator[SEP] identifier[engineDoFinal] operator[SEP] operator[SEP] operator[SEP] identifier[spi] operator[SEP] identifier[engineReset] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[mac] operator[SEP]
}
|
public static ns_ssl_certkey[] get(nitro_service client) throws Exception
{
ns_ssl_certkey resource = new ns_ssl_certkey();
resource.validate("get");
return (ns_ssl_certkey[]) resource.get_resources(client);
} | class class_name[name] begin[{]
method[get, return_type[type[ns_ssl_certkey]], modifier[public static], parameter[client]] begin[{]
local_variable[type[ns_ssl_certkey], resource]
call[resource.validate, parameter[literal["get"]]]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get_resources, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=ns_ssl_certkey, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ns_ssl_certkey] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[client] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[ns_ssl_certkey] identifier[resource] operator[=] Keyword[new] identifier[ns_ssl_certkey] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[validate] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[ns_ssl_certkey] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[get_resources] operator[SEP] identifier[client] operator[SEP] operator[SEP]
}
|
@Override
public void monitor() {
Runtime runtime = Runtime.getRuntime();
double allocatedMemory = runtime.totalMemory() / (double) 1024;
double freeMemory = runtime.freeMemory() / (double) 1024;
double totalFreeMemory = freeMemory + (maxMemory - allocatedMemory);
calculatedAllocatedMemory = allocatedMemory;
calculatedFreeMemory = freeMemory;
calculatedTotalFreeMemory = totalFreeMemory;
this.percentageOfMemoryUsed = (((double) 100) - ((totalFreeMemory / maxMemory) * ((double) 100)));
super.applyNewValue(memoryAlarmLevel, percentageOfMemoryUsed, memoryThreshold, backToNormalMemoryThreshold, true);
} | class class_name[name] begin[{]
method[monitor, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[Runtime], runtime]
local_variable[type[double], allocatedMemory]
local_variable[type[double], freeMemory]
local_variable[type[double], totalFreeMemory]
assign[member[.calculatedAllocatedMemory], member[.allocatedMemory]]
assign[member[.calculatedFreeMemory], member[.freeMemory]]
assign[member[.calculatedTotalFreeMemory], member[.totalFreeMemory]]
assign[THIS[member[None.percentageOfMemoryUsed]], binary_operation[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100), type=BasicType(dimensions=[], name=double)), -, binary_operation[binary_operation[member[.totalFreeMemory], /, member[.maxMemory]], *, Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100), type=BasicType(dimensions=[], name=double))]]]
SuperMethodInvocation(arguments=[MemberReference(member=memoryAlarmLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=percentageOfMemoryUsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=memoryThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=backToNormalMemoryThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=applyNewValue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[monitor] operator[SEP] operator[SEP] {
identifier[Runtime] identifier[runtime] operator[=] identifier[Runtime] operator[SEP] identifier[getRuntime] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[allocatedMemory] operator[=] identifier[runtime] operator[SEP] identifier[totalMemory] operator[SEP] operator[SEP] operator[/] operator[SEP] Keyword[double] operator[SEP] Other[1024] operator[SEP] Keyword[double] identifier[freeMemory] operator[=] identifier[runtime] operator[SEP] identifier[freeMemory] operator[SEP] operator[SEP] operator[/] operator[SEP] Keyword[double] operator[SEP] Other[1024] operator[SEP] Keyword[double] identifier[totalFreeMemory] operator[=] identifier[freeMemory] operator[+] operator[SEP] identifier[maxMemory] operator[-] identifier[allocatedMemory] operator[SEP] operator[SEP] identifier[calculatedAllocatedMemory] operator[=] identifier[allocatedMemory] operator[SEP] identifier[calculatedFreeMemory] operator[=] identifier[freeMemory] operator[SEP] identifier[calculatedTotalFreeMemory] operator[=] identifier[totalFreeMemory] operator[SEP] Keyword[this] operator[SEP] identifier[percentageOfMemoryUsed] operator[=] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] Other[100] operator[SEP] operator[-] operator[SEP] operator[SEP] identifier[totalFreeMemory] operator[/] identifier[maxMemory] operator[SEP] operator[*] operator[SEP] operator[SEP] Keyword[double] operator[SEP] Other[100] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[applyNewValue] operator[SEP] identifier[memoryAlarmLevel] , identifier[percentageOfMemoryUsed] , identifier[memoryThreshold] , identifier[backToNormalMemoryThreshold] , literal[boolean] operator[SEP] operator[SEP]
}
|
public List<DesktopWindowInfo> getDesktopWindowInfoList() {
Response response = executeMessage(DesktopWindowManagerMessage.LIST_WINDOWS, null);
DesktopWindowList.Builder builder = DesktopWindowList.newBuilder();
buildPayload(response, builder);
DesktopWindowList list = builder.build();
return list.getWindowListList();
} | class class_name[name] begin[{]
method[getDesktopWindowInfoList, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[Response], response]
local_variable[type[DesktopWindowList], builder]
call[.buildPayload, parameter[member[.response], member[.builder]]]
local_variable[type[DesktopWindowList], list]
return[call[list.getWindowListList, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[DesktopWindowInfo] operator[>] identifier[getDesktopWindowInfoList] operator[SEP] operator[SEP] {
identifier[Response] identifier[response] operator[=] identifier[executeMessage] operator[SEP] identifier[DesktopWindowManagerMessage] operator[SEP] identifier[LIST_WINDOWS] , Other[null] operator[SEP] operator[SEP] identifier[DesktopWindowList] operator[SEP] identifier[Builder] identifier[builder] operator[=] identifier[DesktopWindowList] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[buildPayload] operator[SEP] identifier[response] , identifier[builder] operator[SEP] operator[SEP] identifier[DesktopWindowList] identifier[list] operator[=] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[list] operator[SEP] identifier[getWindowListList] operator[SEP] operator[SEP] operator[SEP]
}
|
protected void doLoadNextResource() {
// get the next resource from the collector
CmsResource resource = getNextResource();
if (resource == null) {
m_resourceName = null;
m_resource = null;
return;
}
// set the resource name
m_resourceName = m_cms.getSitePath(resource);
// set the resource
m_resource = resource;
} | class class_name[name] begin[{]
method[doLoadNextResource, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[CmsResource], resource]
if[binary_operation[member[.resource], ==, literal[null]]] begin[{]
assign[member[.m_resourceName], literal[null]]
assign[member[.m_resource], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[member[.m_resourceName], call[m_cms.getSitePath, parameter[member[.resource]]]]
assign[member[.m_resource], member[.resource]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[doLoadNextResource] operator[SEP] operator[SEP] {
identifier[CmsResource] identifier[resource] operator[=] identifier[getNextResource] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resource] operator[==] Other[null] operator[SEP] {
identifier[m_resourceName] operator[=] Other[null] operator[SEP] identifier[m_resource] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
identifier[m_resourceName] operator[=] identifier[m_cms] operator[SEP] identifier[getSitePath] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[m_resource] operator[=] identifier[resource] operator[SEP]
}
|
private void resolveAliases(AttributeTable at) throws MalformedAliasException, UnresolvedAliasException, NoSuchAttributeException
{
// Cache the current (parent) Attribute table. This value is
// null if this method is called from parse();
AttributeTable cacheAT = currentAT;
try {
// Set the current AttributeTable to the one that we are searching.
currentAT = at;
if (Debug.isSet("DAS")) {
DAPNode.log.debug("DAS.resolveAliases(at=" + at + ")");
}
//getall of the Attributes from the table.
Enumeration aNames = at.getNames();
while (aNames.hasMoreElements()) {
String aName = (String) aNames.nextElement();
if (Debug.isSet("DAS")) {
DAPNode.log.debug("DAS.resolveAliases(at=" + at + ") - aName: " + aName);
}
opendap.dap.Attribute thisA = currentAT.getAttribute(aName);
if (Debug.isSet("DAS")) {
DAPNode.log.debug("thisA.getClass().getName(): " + thisA.getClass().getName());
}
if (thisA.isAlias()) {
//Is Alias? Resolve it!
resolveAlias((Alias) thisA);
if (Debug.isSet("DAS")) {
DAPNode.log.debug("Resolved Alias: '" + thisA.getEncodedName() + "'\n");
}
} else if (thisA.isContainer()) {
//Is AttributeTable (container)? Search it!
resolveAliases(thisA.getContainer());
}
}
} finally {
// Restore the previous currentAT state.
currentAT = cacheAT;
}
} | class class_name[name] begin[{]
method[resolveAliases, return_type[void], modifier[private], parameter[at]] begin[{]
local_variable[type[AttributeTable], cacheAT]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentAT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=at, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAS")], member=isSet, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAS.resolveAliases(at="), operandr=MemberReference(member=at, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=DAPNode.log, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNames, postfix_operators=[], prefix_operators=[], qualifier=at, selectors=[], type_arguments=None), name=aNames)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Enumeration, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=aNames, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=aName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAS")], member=isSet, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAS.resolveAliases(at="), operandr=MemberReference(member=at, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") - aName: "), operator=+), operandr=MemberReference(member=aName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=DAPNode.log, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=aName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=currentAT, selectors=[], type_arguments=None), name=thisA)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=opendap, sub_type=ReferenceType(arguments=None, dimensions=None, name=dap, sub_type=ReferenceType(arguments=None, dimensions=None, name=Attribute, sub_type=None)))), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAS")], member=isSet, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="thisA.getClass().getName(): "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=thisA, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=DAPNode.log, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isAlias, postfix_operators=[], prefix_operators=[], qualifier=thisA, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=isContainer, postfix_operators=[], prefix_operators=[], qualifier=thisA, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getContainer, postfix_operators=[], prefix_operators=[], qualifier=thisA, selectors=[], type_arguments=None)], member=resolveAliases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=thisA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Alias, sub_type=None))], member=resolveAlias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAS")], member=isSet, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Resolved Alias: '"), operandr=MethodInvocation(arguments=[], member=getEncodedName, postfix_operators=[], prefix_operators=[], qualifier=thisA, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'\n"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=DAPNode.log, selectors=[], type_arguments=None), label=None)]))]))]), condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=aNames, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentAT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=cacheAT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[resolveAliases] operator[SEP] identifier[AttributeTable] identifier[at] operator[SEP] Keyword[throws] identifier[MalformedAliasException] , identifier[UnresolvedAliasException] , identifier[NoSuchAttributeException] {
identifier[AttributeTable] identifier[cacheAT] operator[=] identifier[currentAT] operator[SEP] Keyword[try] {
identifier[currentAT] operator[=] identifier[at] operator[SEP] Keyword[if] operator[SEP] identifier[Debug] operator[SEP] identifier[isSet] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[DAPNode] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[at] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[Enumeration] identifier[aNames] operator[=] identifier[at] operator[SEP] identifier[getNames] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[aNames] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[aName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[aNames] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Debug] operator[SEP] identifier[isSet] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[DAPNode] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[at] operator[+] literal[String] operator[+] identifier[aName] operator[SEP] operator[SEP]
}
identifier[opendap] operator[SEP] identifier[dap] operator[SEP] identifier[Attribute] identifier[thisA] operator[=] identifier[currentAT] operator[SEP] identifier[getAttribute] operator[SEP] identifier[aName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Debug] operator[SEP] identifier[isSet] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[DAPNode] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[thisA] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[thisA] operator[SEP] identifier[isAlias] operator[SEP] operator[SEP] operator[SEP] {
identifier[resolveAlias] operator[SEP] operator[SEP] identifier[Alias] operator[SEP] identifier[thisA] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Debug] operator[SEP] identifier[isSet] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[DAPNode] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[thisA] operator[SEP] identifier[getEncodedName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[thisA] operator[SEP] identifier[isContainer] operator[SEP] operator[SEP] operator[SEP] {
identifier[resolveAliases] operator[SEP] identifier[thisA] operator[SEP] identifier[getContainer] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[finally] {
identifier[currentAT] operator[=] identifier[cacheAT] operator[SEP]
}
}
|
public OvhValidationResult payment_thod_POST(Long billingContactId, OvhCallbackUrl callbackUrl, Boolean _default, String description, Long orderId, String paymentType, Boolean register) throws IOException {
String qPath = "/me/payment/method";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "billingContactId", billingContactId);
addBody(o, "callbackUrl", callbackUrl);
addBody(o, "default", _default);
addBody(o, "description", description);
addBody(o, "orderId", orderId);
addBody(o, "paymentType", paymentType);
addBody(o, "register", register);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhValidationResult.class);
} | class class_name[name] begin[{]
method[payment_thod_POST, return_type[type[OvhValidationResult]], modifier[public], parameter[billingContactId, callbackUrl, _default, description, orderId, paymentType, register]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
local_variable[type[HashMap], o]
call[.addBody, parameter[member[.o], literal["billingContactId"], member[.billingContactId]]]
call[.addBody, parameter[member[.o], literal["callbackUrl"], member[.callbackUrl]]]
call[.addBody, parameter[member[.o], literal["default"], member[._default]]]
call[.addBody, parameter[member[.o], literal["description"], member[.description]]]
call[.addBody, parameter[member[.o], literal["orderId"], member[.orderId]]]
call[.addBody, parameter[member[.o], literal["paymentType"], member[.paymentType]]]
call[.addBody, parameter[member[.o], literal["register"], member[.register]]]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhValidationResult, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[OvhValidationResult] identifier[payment_thod_POST] operator[SEP] identifier[Long] identifier[billingContactId] , identifier[OvhCallbackUrl] identifier[callbackUrl] , identifier[Boolean] identifier[_default] , identifier[String] identifier[description] , identifier[Long] identifier[orderId] , identifier[String] identifier[paymentType] , identifier[Boolean] identifier[register] 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[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[billingContactId] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[callbackUrl] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[_default] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[description] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[orderId] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[paymentType] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[register] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhValidationResult] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public void process( DMatrixRMaj F , List<AssociatedPair> observations ,
int width , int height ) {
int centerX = width/2;
int centerY = height/2;
MultiViewOps.extractEpipoles(F, epipole1, epipole2);
checkEpipoleInside(width, height);
// compute the transform H which will send epipole2 to infinity
SimpleMatrix R = rotateEpipole(epipole2,centerX,centerY);
SimpleMatrix T = translateToOrigin(centerX,centerY);
SimpleMatrix G = computeG(epipole2,centerX,centerY);
SimpleMatrix H = G.mult(R).mult(T);
//Find the two matching transforms
SimpleMatrix Hzero = computeHZero(F,epipole2,H);
SimpleMatrix Ha = computeAffineH(observations,H.getDDRM(),Hzero.getDDRM());
rect1.set(Ha.mult(Hzero).getDDRM());
rect2.set(H.getDDRM());
} | class class_name[name] begin[{]
method[process, return_type[void], modifier[public], parameter[F, observations, width, height]] begin[{]
local_variable[type[int], centerX]
local_variable[type[int], centerY]
call[MultiViewOps.extractEpipoles, parameter[member[.F], member[.epipole1], member[.epipole2]]]
call[.checkEpipoleInside, parameter[member[.width], member[.height]]]
local_variable[type[SimpleMatrix], R]
local_variable[type[SimpleMatrix], T]
local_variable[type[SimpleMatrix], G]
local_variable[type[SimpleMatrix], H]
local_variable[type[SimpleMatrix], Hzero]
local_variable[type[SimpleMatrix], Ha]
call[rect1.set, parameter[call[Ha.mult, parameter[member[.Hzero]]]]]
call[rect2.set, parameter[call[H.getDDRM, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[process] operator[SEP] identifier[DMatrixRMaj] identifier[F] , identifier[List] operator[<] identifier[AssociatedPair] operator[>] identifier[observations] , Keyword[int] identifier[width] , Keyword[int] identifier[height] operator[SEP] {
Keyword[int] identifier[centerX] operator[=] identifier[width] operator[/] Other[2] operator[SEP] Keyword[int] identifier[centerY] operator[=] identifier[height] operator[/] Other[2] operator[SEP] identifier[MultiViewOps] operator[SEP] identifier[extractEpipoles] operator[SEP] identifier[F] , identifier[epipole1] , identifier[epipole2] operator[SEP] operator[SEP] identifier[checkEpipoleInside] operator[SEP] identifier[width] , identifier[height] operator[SEP] operator[SEP] identifier[SimpleMatrix] identifier[R] operator[=] identifier[rotateEpipole] operator[SEP] identifier[epipole2] , identifier[centerX] , identifier[centerY] operator[SEP] operator[SEP] identifier[SimpleMatrix] identifier[T] operator[=] identifier[translateToOrigin] operator[SEP] identifier[centerX] , identifier[centerY] operator[SEP] operator[SEP] identifier[SimpleMatrix] identifier[G] operator[=] identifier[computeG] operator[SEP] identifier[epipole2] , identifier[centerX] , identifier[centerY] operator[SEP] operator[SEP] identifier[SimpleMatrix] identifier[H] operator[=] identifier[G] operator[SEP] identifier[mult] operator[SEP] identifier[R] operator[SEP] operator[SEP] identifier[mult] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[SimpleMatrix] identifier[Hzero] operator[=] identifier[computeHZero] operator[SEP] identifier[F] , identifier[epipole2] , identifier[H] operator[SEP] operator[SEP] identifier[SimpleMatrix] identifier[Ha] operator[=] identifier[computeAffineH] operator[SEP] identifier[observations] , identifier[H] operator[SEP] identifier[getDDRM] operator[SEP] operator[SEP] , identifier[Hzero] operator[SEP] identifier[getDDRM] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[rect1] operator[SEP] identifier[set] operator[SEP] identifier[Ha] operator[SEP] identifier[mult] operator[SEP] identifier[Hzero] operator[SEP] operator[SEP] identifier[getDDRM] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[rect2] operator[SEP] identifier[set] operator[SEP] identifier[H] operator[SEP] identifier[getDDRM] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
static <S,T> TypeAdapter<S,T> createAdapter(Class<? extends S> sourceType, Class<? extends T> targetType) {
return doCreateAdapter(targetType,AdapterMethodValidator.newInstance(targetType, sourceType));
} | class class_name[name] begin[{]
method[createAdapter, return_type[type[TypeAdapter]], modifier[static], parameter[sourceType, targetType]] begin[{]
return[call[.doCreateAdapter, parameter[member[.targetType], call[AdapterMethodValidator.newInstance, parameter[member[.targetType], member[.sourceType]]]]]]
end[}]
END[}] | Keyword[static] operator[<] identifier[S] , identifier[T] operator[>] identifier[TypeAdapter] operator[<] identifier[S] , identifier[T] operator[>] identifier[createAdapter] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[S] operator[>] identifier[sourceType] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[targetType] operator[SEP] {
Keyword[return] identifier[doCreateAdapter] operator[SEP] identifier[targetType] , identifier[AdapterMethodValidator] operator[SEP] identifier[newInstance] operator[SEP] identifier[targetType] , identifier[sourceType] operator[SEP] operator[SEP] operator[SEP]
}
|
public AbstractBooleanList partFromTo(int from, int to) {
if (size==0) return new BooleanArrayList(0);
checkRangeFromTo(from, to, size);
boolean[] part = new boolean[to-from+1];
System.arraycopy(elements, from, part, 0, to-from+1);
return new BooleanArrayList(part);
} | class class_name[name] begin[{]
method[partFromTo, return_type[type[AbstractBooleanList]], modifier[public], parameter[from, to]] begin[{]
if[binary_operation[member[.size], ==, literal[0]]] begin[{]
return[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=BooleanArrayList, sub_type=None))]
else begin[{]
None
end[}]
call[.checkRangeFromTo, parameter[member[.from], member[.to], member[.size]]]
local_variable[type[boolean], part]
call[System.arraycopy, parameter[member[.elements], member[.from], member[.part], literal[0], binary_operation[binary_operation[member[.to], -, member[.from]], +, literal[1]]]]
return[ClassCreator(arguments=[MemberReference(member=part, 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=BooleanArrayList, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[AbstractBooleanList] identifier[partFromTo] operator[SEP] Keyword[int] identifier[from] , Keyword[int] identifier[to] operator[SEP] {
Keyword[if] operator[SEP] identifier[size] operator[==] Other[0] operator[SEP] Keyword[return] Keyword[new] identifier[BooleanArrayList] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[checkRangeFromTo] operator[SEP] identifier[from] , identifier[to] , identifier[size] operator[SEP] operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] identifier[part] operator[=] Keyword[new] Keyword[boolean] operator[SEP] identifier[to] operator[-] identifier[from] operator[+] Other[1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[elements] , identifier[from] , identifier[part] , Other[0] , identifier[to] operator[-] identifier[from] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[BooleanArrayList] operator[SEP] identifier[part] operator[SEP] operator[SEP]
}
|
public String getDefinition(long srsId) {
String definition = connection.querySingleTypedResult("SELECT "
+ COLUMN_NAME + " FROM " + SpatialReferenceSystem.TABLE_NAME
+ " WHERE " + SpatialReferenceSystem.COLUMN_SRS_ID + " = ?",
new String[] { String.valueOf(srsId) });
return definition;
} | class class_name[name] begin[{]
method[getDefinition, return_type[type[String]], modifier[public], parameter[srsId]] begin[{]
local_variable[type[String], definition]
return[member[.definition]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getDefinition] operator[SEP] Keyword[long] identifier[srsId] operator[SEP] {
identifier[String] identifier[definition] operator[=] identifier[connection] operator[SEP] identifier[querySingleTypedResult] operator[SEP] literal[String] operator[+] identifier[COLUMN_NAME] operator[+] literal[String] operator[+] identifier[SpatialReferenceSystem] operator[SEP] identifier[TABLE_NAME] operator[+] literal[String] operator[+] identifier[SpatialReferenceSystem] operator[SEP] identifier[COLUMN_SRS_ID] operator[+] literal[String] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[srsId] operator[SEP]
} operator[SEP] operator[SEP] Keyword[return] identifier[definition] operator[SEP]
}
|
public static <T extends ByteCodeElement> ElementMatcher.Junction<T> isAccessibleTo(Class<?> type) {
return isAccessibleTo(TypeDescription.ForLoadedType.of(type));
} | class class_name[name] begin[{]
method[isAccessibleTo, return_type[type[ElementMatcher]], modifier[public static], parameter[type]] begin[{]
return[call[.isAccessibleTo, parameter[call[TypeDescription.ForLoadedType.of, parameter[member[.type]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[ByteCodeElement] operator[>] identifier[ElementMatcher] operator[SEP] identifier[Junction] operator[<] identifier[T] operator[>] identifier[isAccessibleTo] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[SEP] {
Keyword[return] identifier[isAccessibleTo] operator[SEP] identifier[TypeDescription] operator[SEP] identifier[ForLoadedType] operator[SEP] identifier[of] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AfplibPackage.FONT_FIDELITY__STP_FNT_EX:
setStpFntEx((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
} | class class_name[name] begin[{]
method[eSet, return_type[void], modifier[public], parameter[featureID, newValue]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=FONT_FIDELITY__STP_FNT_EX, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setStpFntEx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eSet] operator[SEP] Keyword[int] identifier[featureID] , identifier[Object] identifier[newValue] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FONT_FIDELITY__STP_FNT_EX] operator[:] identifier[setStpFntEx] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[super] operator[SEP] identifier[eSet] operator[SEP] identifier[featureID] , identifier[newValue] operator[SEP] operator[SEP]
}
|
@Override
public void writeRow(List<Column> columns, Object[] row) throws IOException {
if (row == null) {
return;
}
Writer writer = getWriter();
List<String> valuesToPrint = DataWriterUtil.getRowValues(columns, row, getLocale(), columnFormatters);
for (int currentColumnIndex = 0; currentColumnIndex < columns.size(); currentColumnIndex++) {
writer.write(checkSurroundByQuotes(getDelimiter(), valuesToPrint.get(currentColumnIndex)));
if (currentColumnIndex != columns.size() - 1) {
writer.write(getDelimiter());
}
}
writer.write(getEndline());
writer.flush();
} | class class_name[name] begin[{]
method[writeRow, return_type[void], modifier[public], parameter[columns, row]] begin[{]
if[binary_operation[member[.row], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[Writer], writer]
local_variable[type[List], valuesToPrint]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=currentColumnIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=valuesToPrint, selectors=[], type_arguments=None)], member=checkSurroundByQuotes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=currentColumnIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=currentColumnIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=columns, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=currentColumnIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=currentColumnIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[writer.write, parameter[call[.getEndline, parameter[]]]]
call[writer.flush, parameter[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[writeRow] operator[SEP] identifier[List] operator[<] identifier[Column] operator[>] identifier[columns] , identifier[Object] operator[SEP] operator[SEP] identifier[row] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[row] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[Writer] identifier[writer] operator[=] identifier[getWriter] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[valuesToPrint] operator[=] identifier[DataWriterUtil] operator[SEP] identifier[getRowValues] operator[SEP] identifier[columns] , identifier[row] , identifier[getLocale] operator[SEP] operator[SEP] , identifier[columnFormatters] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[currentColumnIndex] operator[=] Other[0] operator[SEP] identifier[currentColumnIndex] operator[<] identifier[columns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[currentColumnIndex] operator[++] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[checkSurroundByQuotes] operator[SEP] identifier[getDelimiter] operator[SEP] operator[SEP] , identifier[valuesToPrint] operator[SEP] identifier[get] operator[SEP] identifier[currentColumnIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentColumnIndex] operator[!=] identifier[columns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[getDelimiter] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[getEndline] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public FileLock lock(long position, long size, boolean shared) throws IOException
{
return new FileLockImpl(this, position, size, shared);
} | class class_name[name] begin[{]
method[lock, return_type[type[FileLock]], modifier[public], parameter[position, size, shared]] begin[{]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=shared, 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=FileLockImpl, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[FileLock] identifier[lock] operator[SEP] Keyword[long] identifier[position] , Keyword[long] identifier[size] , Keyword[boolean] identifier[shared] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] Keyword[new] identifier[FileLockImpl] operator[SEP] Keyword[this] , identifier[position] , identifier[size] , identifier[shared] operator[SEP] operator[SEP]
}
|
public static String serviceName(Class<?> serviceInterface) {
// Service name
Service serviceAnnotation = serviceInterface.getAnnotation(Service.class);
if (serviceAnnotation == null) {
throw new IllegalArgumentException(
String.format("Not a service interface: %s", serviceInterface));
}
return serviceAnnotation.value().length() > 0
? serviceAnnotation.value()
: serviceInterface.getName();
} | class class_name[name] begin[{]
method[serviceName, return_type[type[String]], modifier[public static], parameter[serviceInterface]] begin[{]
local_variable[type[Service], serviceAnnotation]
if[binary_operation[member[.serviceAnnotation], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not a service interface: %s"), MemberReference(member=serviceInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=serviceAnnotation, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=serviceInterface, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=serviceAnnotation, selectors=[], type_arguments=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[serviceName] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[serviceInterface] operator[SEP] {
identifier[Service] identifier[serviceAnnotation] operator[=] identifier[serviceInterface] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[Service] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[serviceAnnotation] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[serviceInterface] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[serviceAnnotation] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[?] identifier[serviceAnnotation] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[:] identifier[serviceInterface] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String getPDBCharacter(boolean web, char c1, char c2, boolean similar, char c) {
String s = String.valueOf(c);
return getPDBString(web, c1, c2, similar, s, s, s, s);
} | class class_name[name] begin[{]
method[getPDBCharacter, return_type[type[String]], modifier[public static], parameter[web, c1, c2, similar, c]] begin[{]
local_variable[type[String], s]
return[call[.getPDBString, parameter[member[.web], member[.c1], member[.c2], member[.similar], member[.s], member[.s], member[.s], member[.s]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getPDBCharacter] operator[SEP] Keyword[boolean] identifier[web] , Keyword[char] identifier[c1] , Keyword[char] identifier[c2] , Keyword[boolean] identifier[similar] , Keyword[char] identifier[c] operator[SEP] {
identifier[String] identifier[s] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[return] identifier[getPDBString] operator[SEP] identifier[web] , identifier[c1] , identifier[c2] , identifier[similar] , identifier[s] , identifier[s] , identifier[s] , identifier[s] operator[SEP] operator[SEP]
}
|
@Override
public ByteArrayInputStream compare(ImagePlotShape shape, ImageEncoding imageEncoding, String jsonModels)
throws JsonProcessingException, ApiException {
return compare(null, shape, imageEncoding, jsonModels);
} | class class_name[name] begin[{]
method[compare, return_type[type[ByteArrayInputStream]], modifier[public], parameter[shape, imageEncoding, jsonModels]] begin[{]
return[call[.compare, parameter[literal[null], member[.shape], member[.imageEncoding], member[.jsonModels]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ByteArrayInputStream] identifier[compare] operator[SEP] identifier[ImagePlotShape] identifier[shape] , identifier[ImageEncoding] identifier[imageEncoding] , identifier[String] identifier[jsonModels] operator[SEP] Keyword[throws] identifier[JsonProcessingException] , identifier[ApiException] {
Keyword[return] identifier[compare] operator[SEP] Other[null] , identifier[shape] , identifier[imageEncoding] , identifier[jsonModels] operator[SEP] operator[SEP]
}
|
private GrammaticalStructure tagDependencies(Tree tree, boolean makeCopulaVerbHead) {
SemanticHeadFinder headFinder = new SemanticHeadFinder(!makeCopulaVerbHead); // keep copula verbs as head
// string -> true return all tokens including punctuations.
GrammaticalStructure gs = new EnglishGrammaticalStructure(tree, string -> true, headFinder);
return gs;
} | class class_name[name] begin[{]
method[tagDependencies, return_type[type[GrammaticalStructure]], modifier[private], parameter[tree, makeCopulaVerbHead]] begin[{]
local_variable[type[SemanticHeadFinder], headFinder]
local_variable[type[GrammaticalStructure], gs]
return[member[.gs]]
end[}]
END[}] | Keyword[private] identifier[GrammaticalStructure] identifier[tagDependencies] operator[SEP] identifier[Tree] identifier[tree] , Keyword[boolean] identifier[makeCopulaVerbHead] operator[SEP] {
identifier[SemanticHeadFinder] identifier[headFinder] operator[=] Keyword[new] identifier[SemanticHeadFinder] operator[SEP] operator[!] identifier[makeCopulaVerbHead] operator[SEP] operator[SEP] identifier[GrammaticalStructure] identifier[gs] operator[=] Keyword[new] identifier[EnglishGrammaticalStructure] operator[SEP] identifier[tree] , identifier[string] operator[->] literal[boolean] , identifier[headFinder] operator[SEP] operator[SEP] Keyword[return] identifier[gs] operator[SEP]
}
|
public void selectValue(String expectedValue) {
String[] values = checkSelectValue(expectedValue, 0, 0);
String reason = NO_ELEMENT_FOUND;
if (values == null && getElement().is().present()) {
reason = ELEMENT_NOT_SELECT;
}
assertNotNull(reason, values);
assertFalse("Value found: element values of '" + String.join(",", values) +
CONTAINS + expectedValue + "'", Arrays.asList(values).contains(expectedValue));
} | class class_name[name] begin[{]
method[selectValue, return_type[void], modifier[public], parameter[expectedValue]] begin[{]
local_variable[type[String], values]
local_variable[type[String], reason]
if[binary_operation[binary_operation[member[.values], ==, literal[null]], &&, call[.getElement, parameter[]]]] begin[{]
assign[member[.reason], member[.ELEMENT_NOT_SELECT]]
else begin[{]
None
end[}]
call[.assertNotNull, parameter[member[.reason], member[.values]]]
call[.assertFalse, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Value found: element values of '"], +, call[String.join, parameter[literal[","], member[.values]]]], +, member[.CONTAINS]], +, member[.expectedValue]], +, literal["'"]], call[Arrays.asList, parameter[member[.values]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[selectValue] operator[SEP] identifier[String] identifier[expectedValue] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[checkSelectValue] operator[SEP] identifier[expectedValue] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[String] identifier[reason] operator[=] identifier[NO_ELEMENT_FOUND] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[==] Other[null] operator[&&] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[is] operator[SEP] operator[SEP] operator[SEP] identifier[present] operator[SEP] operator[SEP] operator[SEP] {
identifier[reason] operator[=] identifier[ELEMENT_NOT_SELECT] operator[SEP]
}
identifier[assertNotNull] operator[SEP] identifier[reason] , identifier[values] operator[SEP] operator[SEP] identifier[assertFalse] operator[SEP] literal[String] operator[+] identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[values] operator[SEP] operator[+] identifier[CONTAINS] operator[+] identifier[expectedValue] operator[+] literal[String] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[values] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[expectedValue] operator[SEP] operator[SEP] operator[SEP]
}
|
@SequentialOnly
public BiIterator<K, V> iterator() {
final ObjIterator<Entry<K, V>> iter = s.iterator();
final BooleanSupplier hasNext = new BooleanSupplier() {
@Override
public boolean getAsBoolean() {
return iter.hasNext();
}
};
final Consumer<Pair<K, V>> output = new Consumer<Pair<K, V>>() {
private Entry<K, V> entry = null;
@Override
public void accept(Pair<K, V> t) {
entry = iter.next();
t.set(entry.getKey(), entry.getValue());
}
};
return BiIterator.generate(hasNext, output);
} | class class_name[name] begin[{]
method[iterator, return_type[type[BiIterator]], modifier[public], parameter[]] begin[{]
local_variable[type[ObjIterator], iter]
local_variable[type[BooleanSupplier], hasNext]
local_variable[type[Consumer], output]
return[call[BiIterator.generate, parameter[member[.hasNext], member[.output]]]]
end[}]
END[}] | annotation[@] identifier[SequentialOnly] Keyword[public] identifier[BiIterator] operator[<] identifier[K] , identifier[V] operator[>] identifier[iterator] operator[SEP] operator[SEP] {
Keyword[final] identifier[ObjIterator] operator[<] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[iter] operator[=] identifier[s] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[BooleanSupplier] identifier[hasNext] operator[=] Keyword[new] identifier[BooleanSupplier] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[getAsBoolean] operator[SEP] operator[SEP] {
Keyword[return] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] Keyword[final] identifier[Consumer] operator[<] identifier[Pair] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[output] operator[=] Keyword[new] identifier[Consumer] operator[<] identifier[Pair] operator[<] identifier[K] , identifier[V] operator[>] operator[>] operator[SEP] operator[SEP] {
Keyword[private] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[entry] operator[=] Other[null] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[accept] operator[SEP] identifier[Pair] operator[<] identifier[K] , identifier[V] operator[>] identifier[t] operator[SEP] {
identifier[entry] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[t] operator[SEP] identifier[set] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] Keyword[return] identifier[BiIterator] operator[SEP] identifier[generate] operator[SEP] identifier[hasNext] , identifier[output] operator[SEP] operator[SEP]
}
|
@Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLSubClassOfAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | class class_name[name] begin[{]
method[serializeInstance, return_type[void], modifier[public], parameter[streamWriter, instance]] begin[{]
call[.serialize, parameter[member[.streamWriter], member[.instance]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[serializeInstance] operator[SEP] identifier[SerializationStreamWriter] identifier[streamWriter] , identifier[OWLSubClassOfAxiomImpl] identifier[instance] operator[SEP] Keyword[throws] identifier[SerializationException] {
identifier[serialize] operator[SEP] identifier[streamWriter] , identifier[instance] operator[SEP] operator[SEP]
}
|
public boolean isBlockInvoke( DynamicFunctionSymbol dfs )
{
return dfs.getDisplayName().equals( BlockClass.INVOKE_METHOD_NAME ) && _context.compilingBlock();
} | class class_name[name] begin[{]
method[isBlockInvoke, return_type[type[boolean]], modifier[public], parameter[dfs]] begin[{]
return[binary_operation[call[dfs.getDisplayName, parameter[]], &&, call[_context.compilingBlock, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isBlockInvoke] operator[SEP] identifier[DynamicFunctionSymbol] identifier[dfs] operator[SEP] {
Keyword[return] identifier[dfs] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[BlockClass] operator[SEP] identifier[INVOKE_METHOD_NAME] operator[SEP] operator[&&] identifier[_context] operator[SEP] identifier[compilingBlock] operator[SEP] operator[SEP] operator[SEP]
}
|
public RouteResponse status(final Map<Integer, String> status) {
if (status != null) {
if (this.status == null) {
this.status = new LinkedHashMap<>();
this.status.putAll(status);
}
}
return this;
} | class class_name[name] begin[{]
method[status, return_type[type[RouteResponse]], modifier[public], parameter[status]] begin[{]
if[binary_operation[member[.status], !=, literal[null]]] begin[{]
if[binary_operation[THIS[member[None.status]], ==, literal[null]]] begin[{]
assign[THIS[member[None.status]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LinkedHashMap, sub_type=None))]
THIS[member[None.status]call[None.putAll, parameter[member[.status]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[RouteResponse] identifier[status] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[Integer] , identifier[String] operator[>] identifier[status] operator[SEP] {
Keyword[if] operator[SEP] identifier[status] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[status] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[status] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[status] operator[SEP] identifier[putAll] operator[SEP] identifier[status] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static Filesystem fileExists(final File resource)
{
return new Filesystem(resource, new FileFilter()
{
@Override
public boolean accept(File file)
{
return file.exists() && file.isFile();
}
@Override
public String toString()
{
return "Filesystem.fileExists(" + resource.getAbsolutePath() + ")";
}
});
} | class class_name[name] begin[{]
method[fileExists, return_type[type[Filesystem]], modifier[public static], parameter[resource]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isFile, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), operator=&&), label=None)], documentation=None, modifiers={'public'}, name=accept, parameters=[FormalParameter(annotations=[], modifiers=set(), name=file, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Filesystem.fileExists("), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+), label=None)], documentation=None, modifiers={'public'}, name=toString, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileFilter, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Filesystem, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Filesystem] identifier[fileExists] operator[SEP] Keyword[final] identifier[File] identifier[resource] operator[SEP] {
Keyword[return] Keyword[new] identifier[Filesystem] operator[SEP] identifier[resource] , Keyword[new] identifier[FileFilter] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[accept] operator[SEP] identifier[File] identifier[file] operator[SEP] {
Keyword[return] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] identifier[file] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toString] operator[SEP] operator[SEP] {
Keyword[return] literal[String] operator[+] identifier[resource] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
static File getOutputDirectory(MavenProject rootModule) {
String directoryName = rootModule.getBuild().getDirectory() + "/" + OUTPUT_DIRECTORY;
File directory = new File(directoryName);
directory.mkdirs();
return directory;
} | class class_name[name] begin[{]
method[getOutputDirectory, return_type[type[File]], modifier[static], parameter[rootModule]] begin[{]
local_variable[type[String], directoryName]
local_variable[type[File], directory]
call[directory.mkdirs, parameter[]]
return[member[.directory]]
end[}]
END[}] | Keyword[static] identifier[File] identifier[getOutputDirectory] operator[SEP] identifier[MavenProject] identifier[rootModule] operator[SEP] {
identifier[String] identifier[directoryName] operator[=] identifier[rootModule] operator[SEP] identifier[getBuild] operator[SEP] operator[SEP] operator[SEP] identifier[getDirectory] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[OUTPUT_DIRECTORY] operator[SEP] identifier[File] identifier[directory] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[directoryName] operator[SEP] operator[SEP] identifier[directory] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[directory] operator[SEP]
}
|
@Inject
void setExecutionService(@Named(TaskExecutors.IO) @Nullable ExecutorService executionService) {
if (executionService != null) {
this.executionService = executionService;
}
} | class class_name[name] begin[{]
method[setExecutionService, return_type[void], modifier[default], parameter[executionService]] begin[{]
if[binary_operation[member[.executionService], !=, literal[null]]] begin[{]
assign[THIS[member[None.executionService]], member[.executionService]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Inject] Keyword[void] identifier[setExecutionService] operator[SEP] annotation[@] identifier[Named] operator[SEP] identifier[TaskExecutors] operator[SEP] identifier[IO] operator[SEP] annotation[@] identifier[Nullable] identifier[ExecutorService] identifier[executionService] operator[SEP] {
Keyword[if] operator[SEP] identifier[executionService] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[executionService] operator[=] identifier[executionService] operator[SEP]
}
}
|
public List<JAXBElement<Object>> get_GenericApplicationPropertyOfRoom() {
if (_GenericApplicationPropertyOfRoom == null) {
_GenericApplicationPropertyOfRoom = new ArrayList<JAXBElement<Object>>();
}
return this._GenericApplicationPropertyOfRoom;
} | class class_name[name] begin[{]
method[get_GenericApplicationPropertyOfRoom, return_type[type[List]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[._GenericApplicationPropertyOfRoom], ==, literal[null]]] begin[{]
assign[member[._GenericApplicationPropertyOfRoom], 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=JAXBElement, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
return[THIS[member[None._GenericApplicationPropertyOfRoom]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[JAXBElement] operator[<] identifier[Object] operator[>] operator[>] identifier[get_GenericApplicationPropertyOfRoom] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[_GenericApplicationPropertyOfRoom] operator[==] Other[null] operator[SEP] {
identifier[_GenericApplicationPropertyOfRoom] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[JAXBElement] operator[<] identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP] identifier[_GenericApplicationPropertyOfRoom] operator[SEP]
}
|
@CheckReturnValue
public final InviteAction setMaxAge(final Integer maxAge)
{
if (maxAge != null)
Checks.notNegative(maxAge, "maxAge");
this.maxAge = maxAge;
return this;
} | class class_name[name] begin[{]
method[setMaxAge, return_type[type[InviteAction]], modifier[final public], parameter[maxAge]] begin[{]
if[binary_operation[member[.maxAge], !=, literal[null]]] begin[{]
call[Checks.notNegative, parameter[member[.maxAge], literal["maxAge"]]]
else begin[{]
None
end[}]
assign[THIS[member[None.maxAge]], member[.maxAge]]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[CheckReturnValue] Keyword[public] Keyword[final] identifier[InviteAction] identifier[setMaxAge] operator[SEP] Keyword[final] identifier[Integer] identifier[maxAge] operator[SEP] {
Keyword[if] operator[SEP] identifier[maxAge] operator[!=] Other[null] operator[SEP] identifier[Checks] operator[SEP] identifier[notNegative] operator[SEP] identifier[maxAge] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[maxAge] operator[=] identifier[maxAge] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public boolean search(final String dn,
final String filter,
final int scope) throws NamingException {
if (debug()) {
debug("Ldif: About to open " + dn);
}
inp = null;
try {
this.in = new FileInputStream(dn);
} catch (final Throwable t) {
throw new NamingException(t.getMessage());
}
return true;
} | class class_name[name] begin[{]
method[search, return_type[type[boolean]], modifier[public], parameter[dn, filter, scope]] begin[{]
if[call[.debug, parameter[]]] begin[{]
call[.debug, parameter[binary_operation[literal["Ldif: About to open "], +, member[.dn]]]]
else begin[{]
None
end[}]
assign[member[.inp], literal[null]]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=in, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=ClassCreator(arguments=[MemberReference(member=dn, 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=FileInputStream, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NamingException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[search] operator[SEP] Keyword[final] identifier[String] identifier[dn] , Keyword[final] identifier[String] identifier[filter] , Keyword[final] Keyword[int] identifier[scope] operator[SEP] Keyword[throws] identifier[NamingException] {
Keyword[if] operator[SEP] identifier[debug] operator[SEP] operator[SEP] operator[SEP] {
identifier[debug] operator[SEP] literal[String] operator[+] identifier[dn] operator[SEP] operator[SEP]
}
identifier[inp] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[this] operator[SEP] identifier[in] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[dn] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NamingException] operator[SEP] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private void writeObject(ObjectOutputStream out) throws IOException {
if (!_peer.equals(this) && !(_peer instanceof Serializable)) {
throw new IOException("Bean context child delegate does not support serialization!!!");
}
out.defaultWriteObject();
} | class class_name[name] begin[{]
method[writeObject, return_type[void], modifier[private], parameter[out]] begin[{]
if[binary_operation[call[_peer.equals, parameter[THIS[]]], &&, binary_operation[member[._peer], instanceof, type[Serializable]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bean context child delegate does not support serialization!!!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[out.defaultWriteObject, parameter[]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[writeObject] operator[SEP] identifier[ObjectOutputStream] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] operator[!] identifier[_peer] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] operator[&&] operator[!] operator[SEP] identifier[_peer] Keyword[instanceof] identifier[Serializable] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[out] operator[SEP] identifier[defaultWriteObject] operator[SEP] operator[SEP] operator[SEP]
}
|
public String getRemoteHost() {
if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
checkRequestObjectInUse();
}
// 321485
String host = null;
if (this._request != null) {
host = this._request.getRemoteHost();
}
if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"getRemoteHost", "this->"+this+": "+" host --> " + host);
}
return host;
} | class class_name[name] begin[{]
method[getRemoteHost, return_type[type[String]], modifier[public], parameter[]] begin[{]
if[member[WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE]] begin[{]
call[.checkRequestObjectInUse, parameter[]]
else begin[{]
None
end[}]
local_variable[type[String], host]
if[binary_operation[THIS[member[None._request]], !=, literal[null]]] begin[{]
assign[member[.host], THIS[member[None._request]call[None.getRemoteHost, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[logger.isLoggable, parameter[member[Level.FINE]]]]] begin[{]
call[logger.logp, parameter[member[Level.FINE], member[.CLASS_NAME], literal["getRemoteHost"], binary_operation[binary_operation[binary_operation[binary_operation[literal["this->"], +, THIS[]], +, literal[": "]], +, literal[" host --> "]], +, member[.host]]]]
else begin[{]
None
end[}]
return[member[.host]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getRemoteHost] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[WCCustomProperties] operator[SEP] identifier[CHECK_REQUEST_OBJECT_IN_USE] operator[SEP] {
identifier[checkRequestObjectInUse] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[host] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[_request] operator[!=] Other[null] operator[SEP] {
identifier[host] operator[=] Keyword[this] operator[SEP] identifier[_request] operator[SEP] identifier[getRemoteHost] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[+] Keyword[this] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[host] operator[SEP] operator[SEP]
}
Keyword[return] identifier[host] operator[SEP]
}
|
public Object printHelpMessage(CommandLine commandLine, PrintStream stream) {
commandLine.usage(stream);
return null;
} | class class_name[name] begin[{]
method[printHelpMessage, return_type[type[Object]], modifier[public], parameter[commandLine, stream]] begin[{]
call[commandLine.usage, parameter[member[.stream]]]
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[printHelpMessage] operator[SEP] identifier[CommandLine] identifier[commandLine] , identifier[PrintStream] identifier[stream] operator[SEP] {
identifier[commandLine] operator[SEP] identifier[usage] operator[SEP] identifier[stream] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public void setReference(final Reference reference) {
this.reference = reference;
if (reference instanceof PlayerReference) {
setPlayer((PlayerReference) reference);
}
} | class class_name[name] begin[{]
method[setReference, return_type[void], modifier[public], parameter[reference]] begin[{]
assign[THIS[member[None.reference]], member[.reference]]
if[binary_operation[member[.reference], instanceof, type[PlayerReference]]] begin[{]
call[.setPlayer, parameter[Cast(expression=MemberReference(member=reference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PlayerReference, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setReference] operator[SEP] Keyword[final] identifier[Reference] identifier[reference] operator[SEP] {
Keyword[this] operator[SEP] identifier[reference] operator[=] identifier[reference] operator[SEP] Keyword[if] operator[SEP] identifier[reference] Keyword[instanceof] identifier[PlayerReference] operator[SEP] {
identifier[setPlayer] operator[SEP] operator[SEP] identifier[PlayerReference] operator[SEP] identifier[reference] operator[SEP] operator[SEP]
}
}
|
public static EnvironmentRule newInstance(String profile) {
EnvironmentRule environmentRule = new EnvironmentRule();
environmentRule.setProfile(profile);
return environmentRule;
} | class class_name[name] begin[{]
method[newInstance, return_type[type[EnvironmentRule]], modifier[public static], parameter[profile]] begin[{]
local_variable[type[EnvironmentRule], environmentRule]
call[environmentRule.setProfile, parameter[member[.profile]]]
return[member[.environmentRule]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[EnvironmentRule] identifier[newInstance] operator[SEP] identifier[String] identifier[profile] operator[SEP] {
identifier[EnvironmentRule] identifier[environmentRule] operator[=] Keyword[new] identifier[EnvironmentRule] operator[SEP] operator[SEP] operator[SEP] identifier[environmentRule] operator[SEP] identifier[setProfile] operator[SEP] identifier[profile] operator[SEP] operator[SEP] Keyword[return] identifier[environmentRule] operator[SEP]
}
|
public void pushCommandLine(String commandLine) {
// Add new history entry to the end.
history.add(commandLine);
// Maintain max history size.
if (history.size() > maxHistory) {
history.remove(0);
}
// Reset the iteration index.
resetCurrentIndex();
} | class class_name[name] begin[{]
method[pushCommandLine, return_type[void], modifier[public], parameter[commandLine]] begin[{]
call[history.add, parameter[member[.commandLine]]]
if[binary_operation[call[history.size, parameter[]], >, member[.maxHistory]]] begin[{]
call[history.remove, parameter[literal[0]]]
else begin[{]
None
end[}]
call[.resetCurrentIndex, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[pushCommandLine] operator[SEP] identifier[String] identifier[commandLine] operator[SEP] {
identifier[history] operator[SEP] identifier[add] operator[SEP] identifier[commandLine] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[history] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] identifier[maxHistory] operator[SEP] {
identifier[history] operator[SEP] identifier[remove] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
identifier[resetCurrentIndex] operator[SEP] operator[SEP] operator[SEP]
}
|
private static Type findType(String type, String value) throws IllegalArgumentException {
if (type == null || type.length() == 0)
throw new IllegalArgumentException("no SEPA type type given");
if (value == null || value.length() == 0)
throw new IllegalArgumentException("no SEPA version value given");
for (Type t : Type.values()) {
if (t.getType().equalsIgnoreCase(type) && t.getValue().equals(value))
return t;
}
throw new IllegalArgumentException("unknown SEPA version type: " + type + "." + value);
} | class class_name[name] begin[{]
method[findType, return_type[type[Type]], modifier[private static], parameter[type, value]] begin[{]
if[binary_operation[binary_operation[member[.type], ==, literal[null]], ||, binary_operation[call[type.length, parameter[]], ==, literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no SEPA type type given")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.value], ==, literal[null]], ||, binary_operation[call[value.length, parameter[]], ==, literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no SEPA version value given")], 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[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None))), label=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown SEPA version type: "), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=value, 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)
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Type] identifier[findType] operator[SEP] identifier[String] identifier[type] , identifier[String] identifier[value] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[||] identifier[type] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[||] identifier[value] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Type] identifier[t] operator[:] identifier[Type] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[t] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[type] operator[SEP] operator[&&] identifier[t] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[t] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[type] operator[+] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP]
}
|
public Color getColorForBond(IBond bond, RendererModel model) {
if (this.overrideColor != null) {
return overrideColor;
}
Color color = model.getParameter(ColorHash.class).getValue().get(bond);
if (color == null) {
return model.getParameter(DefaultBondColor.class).getValue();
} else {
return color;
}
} | class class_name[name] begin[{]
method[getColorForBond, return_type[type[Color]], modifier[public], parameter[bond, model]] begin[{]
if[binary_operation[THIS[member[None.overrideColor]], !=, literal[null]]] begin[{]
return[member[.overrideColor]]
else begin[{]
None
end[}]
local_variable[type[Color], color]
if[binary_operation[member[.color], ==, literal[null]]] begin[{]
return[call[model.getParameter, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultBondColor, sub_type=None))]]]
else begin[{]
return[member[.color]]
end[}]
end[}]
END[}] | Keyword[public] identifier[Color] identifier[getColorForBond] operator[SEP] identifier[IBond] identifier[bond] , identifier[RendererModel] identifier[model] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[overrideColor] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[overrideColor] operator[SEP]
}
identifier[Color] identifier[color] operator[=] identifier[model] operator[SEP] identifier[getParameter] operator[SEP] identifier[ColorHash] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[bond] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[color] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[model] operator[SEP] identifier[getParameter] operator[SEP] identifier[DefaultBondColor] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[color] operator[SEP]
}
}
|
public void overlay(DepTreeNode node) {
if (node.defineDependencies != null || node.requireDependencies != null) {
setDependencies(node.defineDependencies, node.requireDependencies, node.dependentFeatures, node.lastModified(), node.lastModifiedDep());
}
node.uri = uri;
if (node.getChildren() == null) {
return;
}
for(Map.Entry<String, DepTreeNode> entry : node.getChildren().entrySet()) {
DepTreeNode existing = getChild(entry.getKey());
if (existing == null) {
add(entry.getValue());
} else {
existing.overlay(entry.getValue());
}
}
} | class class_name[name] begin[{]
method[overlay, return_type[void], modifier[public], parameter[node]] begin[{]
if[binary_operation[binary_operation[member[node.defineDependencies], !=, literal[null]], ||, binary_operation[member[node.requireDependencies], !=, literal[null]]]] begin[{]
call[.setDependencies, parameter[member[node.defineDependencies], member[node.requireDependencies], member[node.dependentFeatures], call[node.lastModified, parameter[]], call[node.lastModifiedDep, parameter[]]]]
else begin[{]
None
end[}]
assign[member[node.uri], member[.uri]]
if[binary_operation[call[node.getChildren, parameter[]], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=existing)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DepTreeNode, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=existing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=overlay, postfix_operators=[], prefix_operators=[], qualifier=existing, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[MethodInvocation(arguments=[], member=entrySet, 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=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DepTreeNode, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[overlay] operator[SEP] identifier[DepTreeNode] identifier[node] operator[SEP] {
Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[defineDependencies] operator[!=] Other[null] operator[||] identifier[node] operator[SEP] identifier[requireDependencies] operator[!=] Other[null] operator[SEP] {
identifier[setDependencies] operator[SEP] identifier[node] operator[SEP] identifier[defineDependencies] , identifier[node] operator[SEP] identifier[requireDependencies] , identifier[node] operator[SEP] identifier[dependentFeatures] , identifier[node] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] , identifier[node] operator[SEP] identifier[lastModifiedDep] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[node] operator[SEP] identifier[uri] operator[=] identifier[uri] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[DepTreeNode] operator[>] identifier[entry] operator[:] identifier[node] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[DepTreeNode] identifier[existing] operator[=] identifier[getChild] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existing] operator[==] Other[null] operator[SEP] {
identifier[add] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[existing] operator[SEP] identifier[overlay] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public final Set<Variable> vars() {
if (vars == null) {
ImmutableSet.Builder<Variable> builder = ImmutableSet.<Variable>builder().add(start());
Variable end = end();
if (end != null) builder.add(end);
builder.addAll(otherVars());
vars = builder.build();
}
return vars;
} | class class_name[name] begin[{]
method[vars, return_type[type[Set]], modifier[final public], parameter[]] begin[{]
if[binary_operation[member[.vars], ==, literal[null]]] begin[{]
local_variable[type[ImmutableSet], builder]
local_variable[type[Variable], end]
if[binary_operation[member[.end], !=, literal[null]]] begin[{]
call[builder.add, parameter[member[.end]]]
else begin[{]
None
end[}]
call[builder.addAll, parameter[call[.otherVars, parameter[]]]]
assign[member[.vars], call[builder.build, parameter[]]]
else begin[{]
None
end[}]
return[member[.vars]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[Set] operator[<] identifier[Variable] operator[>] identifier[vars] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[vars] operator[==] Other[null] operator[SEP] {
identifier[ImmutableSet] operator[SEP] identifier[Builder] operator[<] identifier[Variable] operator[>] identifier[builder] operator[=] identifier[ImmutableSet] operator[SEP] operator[<] identifier[Variable] operator[>] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Variable] identifier[end] operator[=] identifier[end] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[end] operator[!=] Other[null] operator[SEP] identifier[builder] operator[SEP] identifier[add] operator[SEP] identifier[end] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addAll] operator[SEP] identifier[otherVars] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[vars] operator[=] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[vars] operator[SEP]
}
|
@Override
public ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern,
int[] types)
throws SQLException {
String sql =
"SELECT ' ' TYPE_CAT, NULL TYPE_SCHEM, ' ' TYPE_NAME, ' ' CLASS_NAME, 0 DATA_TYPE, ' ' REMARKS, 0 BASE_TYPE"
+ " FROM DUAL WHERE 1=0";
return executeQuery(sql);
} | class class_name[name] begin[{]
method[getUDTs, return_type[type[ResultSet]], modifier[public], parameter[catalog, schemaPattern, typeNamePattern, types]] begin[{]
local_variable[type[String], sql]
return[call[.executeQuery, parameter[member[.sql]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ResultSet] identifier[getUDTs] operator[SEP] identifier[String] identifier[catalog] , identifier[String] identifier[schemaPattern] , identifier[String] identifier[typeNamePattern] , Keyword[int] operator[SEP] operator[SEP] identifier[types] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[String] identifier[sql] operator[=] literal[String] operator[+] literal[String] operator[SEP] Keyword[return] identifier[executeQuery] operator[SEP] identifier[sql] operator[SEP] operator[SEP]
}
|
public static IdentifierHandler<? extends Identifier> getHandlerFor(Element element) {
if (sIdentifierHandlers == null) {
initializeDefaultHandlers();
}
String nodeName = element.getNodeName();
if (nodeName.equalsIgnoreCase(IfmapStrings.ACCESS_REQUEST_EL_NAME)) {
return sIdentifierHandlers.get(AccessRequest.class);
} else if (nodeName.equalsIgnoreCase(IfmapStrings.DEVICE_EL_NAME)) {
return sIdentifierHandlers.get(Device.class);
} else if (nodeName.equalsIgnoreCase(IfmapStrings.IP_ADDRESS_EL_NAME)) {
return sIdentifierHandlers.get(IpAddress.class);
} else if (nodeName.equalsIgnoreCase(IfmapStrings.MAC_ADDRESS_EL_NAME)) {
return sIdentifierHandlers.get(MacAddress.class);
} else if (nodeName.equalsIgnoreCase(IfmapStrings.IDENTITY_EL_NAME)) {
if (checkExtendedIdentityElement(element)) {
IdentifierHandler<? extends Identifier> handler = getExtendedIdentifierHandlerFor(element);
if (handler != null) {
return handler;
}
}
return sIdentifierHandlers.get(Identity.class);
}
return getOtherIdentifierHandlerFor(element);
} | class class_name[name] begin[{]
method[getHandlerFor, return_type[type[IdentifierHandler]], modifier[public static], parameter[element]] begin[{]
if[binary_operation[member[.sIdentifierHandlers], ==, literal[null]]] begin[{]
call[.initializeDefaultHandlers, parameter[]]
else begin[{]
None
end[}]
local_variable[type[String], nodeName]
if[call[nodeName.equalsIgnoreCase, parameter[member[IfmapStrings.ACCESS_REQUEST_EL_NAME]]]] begin[{]
return[call[sIdentifierHandlers.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AccessRequest, sub_type=None))]]]
else begin[{]
if[call[nodeName.equalsIgnoreCase, parameter[member[IfmapStrings.DEVICE_EL_NAME]]]] begin[{]
return[call[sIdentifierHandlers.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Device, sub_type=None))]]]
else begin[{]
if[call[nodeName.equalsIgnoreCase, parameter[member[IfmapStrings.IP_ADDRESS_EL_NAME]]]] begin[{]
return[call[sIdentifierHandlers.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IpAddress, sub_type=None))]]]
else begin[{]
if[call[nodeName.equalsIgnoreCase, parameter[member[IfmapStrings.MAC_ADDRESS_EL_NAME]]]] begin[{]
return[call[sIdentifierHandlers.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MacAddress, sub_type=None))]]]
else begin[{]
if[call[nodeName.equalsIgnoreCase, parameter[member[IfmapStrings.IDENTITY_EL_NAME]]]] begin[{]
if[call[.checkExtendedIdentityElement, parameter[member[.element]]]] begin[{]
local_variable[type[IdentifierHandler], handler]
if[binary_operation[member[.handler], !=, literal[null]]] begin[{]
return[member[.handler]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[call[sIdentifierHandlers.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Identity, sub_type=None))]]]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
end[}]
return[call[.getOtherIdentifierHandlerFor, parameter[member[.element]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[IdentifierHandler] operator[<] operator[?] Keyword[extends] identifier[Identifier] operator[>] identifier[getHandlerFor] operator[SEP] identifier[Element] identifier[element] operator[SEP] {
Keyword[if] operator[SEP] identifier[sIdentifierHandlers] operator[==] Other[null] operator[SEP] {
identifier[initializeDefaultHandlers] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[nodeName] operator[=] identifier[element] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[IfmapStrings] operator[SEP] identifier[ACCESS_REQUEST_EL_NAME] operator[SEP] operator[SEP] {
Keyword[return] identifier[sIdentifierHandlers] operator[SEP] identifier[get] operator[SEP] identifier[AccessRequest] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[nodeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[IfmapStrings] operator[SEP] identifier[DEVICE_EL_NAME] operator[SEP] operator[SEP] {
Keyword[return] identifier[sIdentifierHandlers] operator[SEP] identifier[get] operator[SEP] identifier[Device] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[nodeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[IfmapStrings] operator[SEP] identifier[IP_ADDRESS_EL_NAME] operator[SEP] operator[SEP] {
Keyword[return] identifier[sIdentifierHandlers] operator[SEP] identifier[get] operator[SEP] identifier[IpAddress] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[nodeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[IfmapStrings] operator[SEP] identifier[MAC_ADDRESS_EL_NAME] operator[SEP] operator[SEP] {
Keyword[return] identifier[sIdentifierHandlers] operator[SEP] identifier[get] operator[SEP] identifier[MacAddress] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[nodeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[IfmapStrings] operator[SEP] identifier[IDENTITY_EL_NAME] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[checkExtendedIdentityElement] operator[SEP] identifier[element] operator[SEP] operator[SEP] {
identifier[IdentifierHandler] operator[<] operator[?] Keyword[extends] identifier[Identifier] operator[>] identifier[handler] operator[=] identifier[getExtendedIdentifierHandlerFor] operator[SEP] identifier[element] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handler] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[handler] operator[SEP]
}
}
Keyword[return] identifier[sIdentifierHandlers] operator[SEP] identifier[get] operator[SEP] identifier[Identity] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[return] identifier[getOtherIdentifierHandlerFor] operator[SEP] identifier[element] operator[SEP] operator[SEP]
}
|
public static RandomVariable getSwapAnnuity(TimeDiscretization tenor, DiscountCurveInterface discountCurve) {
return getSwapAnnuity(new RegularSchedule(tenor), discountCurve);
} | class class_name[name] begin[{]
method[getSwapAnnuity, return_type[type[RandomVariable]], modifier[public static], parameter[tenor, discountCurve]] begin[{]
return[call[.getSwapAnnuity, parameter[ClassCreator(arguments=[MemberReference(member=tenor, 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=RegularSchedule, sub_type=None)), member[.discountCurve]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[RandomVariable] identifier[getSwapAnnuity] operator[SEP] identifier[TimeDiscretization] identifier[tenor] , identifier[DiscountCurveInterface] identifier[discountCurve] operator[SEP] {
Keyword[return] identifier[getSwapAnnuity] operator[SEP] Keyword[new] identifier[RegularSchedule] operator[SEP] identifier[tenor] operator[SEP] , identifier[discountCurve] operator[SEP] operator[SEP]
}
|
public static int cublasScasum(
cublasHandle handle,
int n,
Pointer x,
int incx,
Pointer result)/** host or device pointer */
{
return checkResult(cublasScasumNative(handle, n, x, incx, result));
} | class class_name[name] begin[{]
method[cublasScasum, return_type[type[int]], modifier[public static], parameter[handle, n, x, incx, result]] begin[{]
return[call[.checkResult, parameter[call[.cublasScasumNative, parameter[member[.handle], member[.n], member[.x], member[.incx], member[.result]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[cublasScasum] operator[SEP] identifier[cublasHandle] identifier[handle] , Keyword[int] identifier[n] , identifier[Pointer] identifier[x] , Keyword[int] identifier[incx] , identifier[Pointer] identifier[result] operator[SEP] {
Keyword[return] identifier[checkResult] operator[SEP] identifier[cublasScasumNative] operator[SEP] identifier[handle] , identifier[n] , identifier[x] , identifier[incx] , identifier[result] operator[SEP] operator[SEP] operator[SEP]
}
|
public BacnetDevice getDevice(long gatewayid, long instanceNumber) {
InternalRequest internalRequest =
createRequest(new GenericAccountRequest(), HttpMethodName.GET, BACNET, DEVICE, GATEWAY,
String.valueOf(gatewayid), DEVICE, String.valueOf(instanceNumber));
return this.invokeHttpClient(internalRequest, BacnetDevice.class);
} | class class_name[name] begin[{]
method[getDevice, return_type[type[BacnetDevice]], modifier[public], parameter[gatewayid, instanceNumber]] begin[{]
local_variable[type[InternalRequest], internalRequest]
return[THIS[call[None.invokeHttpClient, parameter[member[.internalRequest], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BacnetDevice, sub_type=None))]]]]
end[}]
END[}] | Keyword[public] identifier[BacnetDevice] identifier[getDevice] operator[SEP] Keyword[long] identifier[gatewayid] , Keyword[long] identifier[instanceNumber] operator[SEP] {
identifier[InternalRequest] identifier[internalRequest] operator[=] identifier[createRequest] operator[SEP] Keyword[new] identifier[GenericAccountRequest] operator[SEP] operator[SEP] , identifier[HttpMethodName] operator[SEP] identifier[GET] , identifier[BACNET] , identifier[DEVICE] , identifier[GATEWAY] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[gatewayid] operator[SEP] , identifier[DEVICE] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[instanceNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[invokeHttpClient] operator[SEP] identifier[internalRequest] , identifier[BacnetDevice] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public static Map<String, String> parseQueryString(String s) {
Map<String, String> ht = new HashMap<String, String>();
StringTokenizer st = new StringTokenizer(s, "&");
while (st.hasMoreTokens()) {
String pair = st.nextToken();
int pos = pair.indexOf('=');
if (pos == -1) {
ht.put(pair.toLowerCase(), "");
} else {
ht.put(pair.substring(0, pos).toLowerCase(),
pair.substring(pos + 1));
}
}
return ht;
} | class class_name[name] begin[{]
method[parseQueryString, return_type[type[Map]], modifier[public static], parameter[s]] begin[{]
local_variable[type[Map], ht]
local_variable[type[StringTokenizer], st]
while[call[st.hasMoreTokens, parameter[]]] begin[{]
local_variable[type[String], pair]
local_variable[type[int], pos]
if[binary_operation[member[.pos], ==, literal[1]]] begin[{]
call[ht.put, parameter[call[pair.toLowerCase, parameter[]], literal[""]]]
else begin[{]
call[ht.put, parameter[call[pair.substring, parameter[literal[0], member[.pos]]], call[pair.substring, parameter[binary_operation[member[.pos], +, literal[1]]]]]]
end[}]
end[}]
return[member[.ht]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parseQueryString] operator[SEP] identifier[String] identifier[s] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[ht] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[StringTokenizer] identifier[st] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[s] , literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[st] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[pair] operator[=] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[pos] operator[=] identifier[pair] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[==] operator[-] Other[1] operator[SEP] {
identifier[ht] operator[SEP] identifier[put] operator[SEP] identifier[pair] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ht] operator[SEP] identifier[put] operator[SEP] identifier[pair] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[pos] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] , identifier[pair] operator[SEP] identifier[substring] operator[SEP] identifier[pos] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[ht] operator[SEP]
}
|
public void close () {
Connection[] connections = this.connections;
for (int i = 0; i < connections.length; i++)
connections[i].removeListener(invokeListener);
synchronized (instancesLock) {
ArrayList<ObjectSpace> temp = new ArrayList(Arrays.asList(instances));
temp.remove(this);
instances = temp.toArray(new ObjectSpace[temp.size()]);
}
if (TRACE) trace("kryonet", "Closed ObjectSpace.");
} | class class_name[name] begin[{]
method[close, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[Connection], connections]
ForStatement(body=StatementExpression(expression=MemberReference(member=connections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=invokeListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=connections, 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)
SYNCHRONIZED[member[.instancesLock]] BEGIN[{]
local_variable[type[ArrayList], temp]
call[temp.remove, parameter[THIS[]]]
assign[member[.instances], call[temp.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectSpace, sub_type=None))]]]
END[}]
if[member[.TRACE]] begin[{]
call[.trace, parameter[literal["kryonet"], literal["Closed ObjectSpace."]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] {
identifier[Connection] operator[SEP] operator[SEP] identifier[connections] operator[=] Keyword[this] operator[SEP] identifier[connections] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[connections] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[connections] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[removeListener] operator[SEP] identifier[invokeListener] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[instancesLock] operator[SEP] {
identifier[ArrayList] operator[<] identifier[ObjectSpace] operator[>] identifier[temp] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[instances] operator[SEP] operator[SEP] operator[SEP] identifier[temp] operator[SEP] identifier[remove] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[instances] operator[=] identifier[temp] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[ObjectSpace] operator[SEP] identifier[temp] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TRACE] operator[SEP] identifier[trace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP]
}
|
public String getHyperlink()
{
String strMailTo = this.getString();
if (strMailTo != null) if (strMailTo.length() > 0)
strMailTo = DBParams.FAX + ":" + strMailTo;
return strMailTo;
} | class class_name[name] begin[{]
method[getHyperlink, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[String], strMailTo]
if[binary_operation[member[.strMailTo], !=, literal[null]]] begin[{]
if[binary_operation[call[strMailTo.length, parameter[]], >, literal[0]]] begin[{]
assign[member[.strMailTo], binary_operation[binary_operation[member[DBParams.FAX], +, literal[":"]], +, member[.strMailTo]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.strMailTo]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getHyperlink] operator[SEP] operator[SEP] {
identifier[String] identifier[strMailTo] operator[=] Keyword[this] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strMailTo] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[strMailTo] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] identifier[strMailTo] operator[=] identifier[DBParams] operator[SEP] identifier[FAX] operator[+] literal[String] operator[+] identifier[strMailTo] operator[SEP] Keyword[return] identifier[strMailTo] operator[SEP]
}
|
public <T> void vaultClass(Class<T> vaultClass)
{
if (! Vault.class.isAssignableFrom(vaultClass)) {
throw new IllegalStateException();
}
Set<?> bogusMethods;
if (Modifier.isAbstract(vaultClass.getModifiers())
&& (bogusMethods = getBogusMethods(vaultClass)).size() > 0) {
throw error(
"vault class '{0}' is invalid because the abstract methods '{1}' can't be generated.",
vaultClass.getName(),
bogusMethods);
}
TypeRef vaultRef = TypeRef.of(vaultClass);
TypeRef keyRef = vaultRef.to(Vault.class).param(0);
TypeRef assetRef = vaultRef.to(Vault.class).param(1);
_validatorService.serviceClass(assetRef.rawClass());
idValidation(assetRef.rawClass(), keyRef.rawClass());
createValidation(vaultClass, assetRef.rawClass(), keyRef.rawClass());
findValidation(vaultClass, assetRef.rawClass(), keyRef.rawClass());
} | class class_name[name] begin[{]
method[vaultClass, return_type[void], modifier[public], parameter[vaultClass]] begin[{]
if[ClassReference(postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=vaultClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Vault, sub_type=None))] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Set], bogusMethods]
if[binary_operation[call[Modifier.isAbstract, parameter[call[vaultClass.getModifiers, parameter[]]]], &&, binary_operation[assign[member[.bogusMethods], call[.getBogusMethods, parameter[member[.vaultClass]]]], >, literal[0]]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="vault class '{0}' is invalid because the abstract methods '{1}' can't be generated."), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=vaultClass, selectors=[], type_arguments=None), MemberReference(member=bogusMethods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
local_variable[type[TypeRef], vaultRef]
local_variable[type[TypeRef], keyRef]
local_variable[type[TypeRef], assetRef]
call[_validatorService.serviceClass, parameter[call[assetRef.rawClass, parameter[]]]]
call[.idValidation, parameter[call[assetRef.rawClass, parameter[]], call[keyRef.rawClass, parameter[]]]]
call[.createValidation, parameter[member[.vaultClass], call[assetRef.rawClass, parameter[]], call[keyRef.rawClass, parameter[]]]]
call[.findValidation, parameter[member[.vaultClass], call[assetRef.rawClass, parameter[]], call[keyRef.rawClass, parameter[]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] Keyword[void] identifier[vaultClass] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[vaultClass] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[Vault] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[vaultClass] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Set] operator[<] operator[?] operator[>] identifier[bogusMethods] operator[SEP] Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[vaultClass] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[bogusMethods] operator[=] identifier[getBogusMethods] operator[SEP] identifier[vaultClass] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[throw] identifier[error] operator[SEP] literal[String] , identifier[vaultClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[bogusMethods] operator[SEP] operator[SEP]
}
identifier[TypeRef] identifier[vaultRef] operator[=] identifier[TypeRef] operator[SEP] identifier[of] operator[SEP] identifier[vaultClass] operator[SEP] operator[SEP] identifier[TypeRef] identifier[keyRef] operator[=] identifier[vaultRef] operator[SEP] identifier[to] operator[SEP] identifier[Vault] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[param] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[TypeRef] identifier[assetRef] operator[=] identifier[vaultRef] operator[SEP] identifier[to] operator[SEP] identifier[Vault] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[param] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[_validatorService] operator[SEP] identifier[serviceClass] operator[SEP] identifier[assetRef] operator[SEP] identifier[rawClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[idValidation] operator[SEP] identifier[assetRef] operator[SEP] identifier[rawClass] operator[SEP] operator[SEP] , identifier[keyRef] operator[SEP] identifier[rawClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[createValidation] operator[SEP] identifier[vaultClass] , identifier[assetRef] operator[SEP] identifier[rawClass] operator[SEP] operator[SEP] , identifier[keyRef] operator[SEP] identifier[rawClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[findValidation] operator[SEP] identifier[vaultClass] , identifier[assetRef] operator[SEP] identifier[rawClass] operator[SEP] operator[SEP] , identifier[keyRef] operator[SEP] identifier[rawClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public ConfigPropertyType<AdminobjectType<T>> getOrCreateConfigProperty()
{
List<Node> nodeList = childNode.get("config-property");
if (nodeList != null && nodeList.size() > 0)
{
return new ConfigPropertyTypeImpl<AdminobjectType<T>>(this, "config-property", childNode, nodeList.get(0));
}
return createConfigProperty();
} | class class_name[name] begin[{]
method[getOrCreateConfigProperty, return_type[type[ConfigPropertyType]], modifier[public], parameter[]] begin[{]
local_variable[type[List], nodeList]
if[binary_operation[binary_operation[member[.nodeList], !=, literal[null]], &&, binary_operation[call[nodeList.size, parameter[]], >, literal[0]]]] begin[{]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="config-property"), MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=nodeList, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=AdminobjectType, sub_type=None))], dimensions=None, name=ConfigPropertyTypeImpl, sub_type=None))]
else begin[{]
None
end[}]
return[call[.createConfigProperty, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[ConfigPropertyType] operator[<] identifier[AdminobjectType] operator[<] identifier[T] operator[>] operator[>] identifier[getOrCreateConfigProperty] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[Node] operator[>] identifier[nodeList] operator[=] identifier[childNode] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodeList] operator[!=] Other[null] operator[&&] identifier[nodeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[return] Keyword[new] identifier[ConfigPropertyTypeImpl] operator[<] identifier[AdminobjectType] operator[<] identifier[T] operator[>] operator[>] operator[SEP] Keyword[this] , literal[String] , identifier[childNode] , identifier[nodeList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[createConfigProperty] operator[SEP] operator[SEP] operator[SEP]
}
|
public Feature asFeature(Object objectToTransform) throws InvalidObjectReaderException {
if (objectToTransform == null) {
throw new IllegalArgumentException("Given object may not be null");
}
if (objectToTransform.getClass() != entityClass) {
throw new InvalidObjectReaderException("Class of target object does not correspond with entityclass of this reader.");
}
Feature proxy = (Feature) Proxy.newProxyInstance(entityClass.getClassLoader(),
new Class[]{Feature.class}, new ObjectInvocationHandler(objectToTransform));
return proxy;
} | class class_name[name] begin[{]
method[asFeature, return_type[type[Feature]], modifier[public], parameter[objectToTransform]] begin[{]
if[binary_operation[member[.objectToTransform], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Given object may not be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[objectToTransform.getClass, parameter[]], !=, member[.entityClass]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Class of target object does not correspond with entityclass of this reader.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidObjectReaderException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Feature], proxy]
return[member[.proxy]]
end[}]
END[}] | Keyword[public] identifier[Feature] identifier[asFeature] operator[SEP] identifier[Object] identifier[objectToTransform] operator[SEP] Keyword[throws] identifier[InvalidObjectReaderException] {
Keyword[if] operator[SEP] identifier[objectToTransform] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[objectToTransform] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[!=] identifier[entityClass] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidObjectReaderException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Feature] identifier[proxy] operator[=] operator[SEP] identifier[Feature] operator[SEP] identifier[Proxy] operator[SEP] identifier[newProxyInstance] operator[SEP] identifier[entityClass] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] {
identifier[Feature] operator[SEP] Keyword[class]
} , Keyword[new] identifier[ObjectInvocationHandler] operator[SEP] identifier[objectToTransform] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[proxy] operator[SEP]
}
|
protected void defineOwnProperty(Context cx, Object id, ScriptableObject desc,
boolean checkValid) {
Slot slot = getSlot(cx, id, SlotAccess.QUERY);
boolean isNew = slot == null;
if (checkValid) {
ScriptableObject current = slot == null ?
null : slot.getPropertyDescriptor(cx, this);
checkPropertyChange(id, current, desc);
}
boolean isAccessor = isAccessorDescriptor(desc);
final int attributes;
if (slot == null) { // new slot
slot = getSlot(cx, id, isAccessor ? SlotAccess.MODIFY_GETTER_SETTER : SlotAccess.MODIFY);
attributes = applyDescriptorToAttributeBitset(DONTENUM|READONLY|PERMANENT, desc);
} else {
attributes = applyDescriptorToAttributeBitset(slot.getAttributes(), desc);
}
if (isAccessor) {
if ( !(slot instanceof GetterSlot) ) {
slot = getSlot(cx, id, SlotAccess.MODIFY_GETTER_SETTER);
}
GetterSlot gslot = (GetterSlot) slot;
Object getter = getProperty(desc, "get");
if (getter != NOT_FOUND) {
gslot.getter = getter;
}
Object setter = getProperty(desc, "set");
if (setter != NOT_FOUND) {
gslot.setter = setter;
}
gslot.value = Undefined.instance;
gslot.setAttributes(attributes);
} else {
if (slot instanceof GetterSlot && isDataDescriptor(desc)) {
slot = getSlot(cx, id, SlotAccess.CONVERT_ACCESSOR_TO_DATA);
}
Object value = getProperty(desc, "value");
if (value != NOT_FOUND) {
slot.value = value;
} else if (isNew) {
slot.value = Undefined.instance;
}
slot.setAttributes(attributes);
}
} | class class_name[name] begin[{]
method[defineOwnProperty, return_type[void], modifier[protected], parameter[cx, id, desc, checkValid]] begin[{]
local_variable[type[Slot], slot]
local_variable[type[boolean], isNew]
if[member[.checkValid]] begin[{]
local_variable[type[ScriptableObject], current]
call[.checkPropertyChange, parameter[member[.id], member[.current], member[.desc]]]
else begin[{]
None
end[}]
local_variable[type[boolean], isAccessor]
local_variable[type[int], attributes]
if[binary_operation[member[.slot], ==, literal[null]]] begin[{]
assign[member[.slot], call[.getSlot, parameter[member[.cx], member[.id], TernaryExpression(condition=MemberReference(member=isAccessor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=MODIFY, postfix_operators=[], prefix_operators=[], qualifier=SlotAccess, selectors=[]), if_true=MemberReference(member=MODIFY_GETTER_SETTER, postfix_operators=[], prefix_operators=[], qualifier=SlotAccess, selectors=[]))]]]
assign[member[.attributes], call[.applyDescriptorToAttributeBitset, parameter[binary_operation[binary_operation[member[.DONTENUM], |, member[.READONLY]], |, member[.PERMANENT]], member[.desc]]]]
else begin[{]
assign[member[.attributes], call[.applyDescriptorToAttributeBitset, parameter[call[slot.getAttributes, parameter[]], member[.desc]]]]
end[}]
if[member[.isAccessor]] begin[{]
if[binary_operation[member[.slot], instanceof, type[GetterSlot]]] begin[{]
assign[member[.slot], call[.getSlot, parameter[member[.cx], member[.id], member[SlotAccess.MODIFY_GETTER_SETTER]]]]
else begin[{]
None
end[}]
local_variable[type[GetterSlot], gslot]
local_variable[type[Object], getter]
if[binary_operation[member[.getter], !=, member[.NOT_FOUND]]] begin[{]
assign[member[gslot.getter], member[.getter]]
else begin[{]
None
end[}]
local_variable[type[Object], setter]
if[binary_operation[member[.setter], !=, member[.NOT_FOUND]]] begin[{]
assign[member[gslot.setter], member[.setter]]
else begin[{]
None
end[}]
assign[member[gslot.value], member[Undefined.instance]]
call[gslot.setAttributes, parameter[member[.attributes]]]
else begin[{]
if[binary_operation[binary_operation[member[.slot], instanceof, type[GetterSlot]], &&, call[.isDataDescriptor, parameter[member[.desc]]]]] begin[{]
assign[member[.slot], call[.getSlot, parameter[member[.cx], member[.id], member[SlotAccess.CONVERT_ACCESSOR_TO_DATA]]]]
else begin[{]
None
end[}]
local_variable[type[Object], value]
if[binary_operation[member[.value], !=, member[.NOT_FOUND]]] begin[{]
assign[member[slot.value], member[.value]]
else begin[{]
if[member[.isNew]] begin[{]
assign[member[slot.value], member[Undefined.instance]]
else begin[{]
None
end[}]
end[}]
call[slot.setAttributes, parameter[member[.attributes]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[defineOwnProperty] operator[SEP] identifier[Context] identifier[cx] , identifier[Object] identifier[id] , identifier[ScriptableObject] identifier[desc] , Keyword[boolean] identifier[checkValid] operator[SEP] {
identifier[Slot] identifier[slot] operator[=] identifier[getSlot] operator[SEP] identifier[cx] , identifier[id] , identifier[SlotAccess] operator[SEP] identifier[QUERY] operator[SEP] operator[SEP] Keyword[boolean] identifier[isNew] operator[=] identifier[slot] operator[==] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[checkValid] operator[SEP] {
identifier[ScriptableObject] identifier[current] operator[=] identifier[slot] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[slot] operator[SEP] identifier[getPropertyDescriptor] operator[SEP] identifier[cx] , Keyword[this] operator[SEP] operator[SEP] identifier[checkPropertyChange] operator[SEP] identifier[id] , identifier[current] , identifier[desc] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[isAccessor] operator[=] identifier[isAccessorDescriptor] operator[SEP] identifier[desc] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[attributes] operator[SEP] Keyword[if] operator[SEP] identifier[slot] operator[==] Other[null] operator[SEP] {
identifier[slot] operator[=] identifier[getSlot] operator[SEP] identifier[cx] , identifier[id] , identifier[isAccessor] operator[?] identifier[SlotAccess] operator[SEP] identifier[MODIFY_GETTER_SETTER] operator[:] identifier[SlotAccess] operator[SEP] identifier[MODIFY] operator[SEP] operator[SEP] identifier[attributes] operator[=] identifier[applyDescriptorToAttributeBitset] operator[SEP] identifier[DONTENUM] operator[|] identifier[READONLY] operator[|] identifier[PERMANENT] , identifier[desc] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[attributes] operator[=] identifier[applyDescriptorToAttributeBitset] operator[SEP] identifier[slot] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] , identifier[desc] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isAccessor] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[slot] Keyword[instanceof] identifier[GetterSlot] operator[SEP] operator[SEP] {
identifier[slot] operator[=] identifier[getSlot] operator[SEP] identifier[cx] , identifier[id] , identifier[SlotAccess] operator[SEP] identifier[MODIFY_GETTER_SETTER] operator[SEP] operator[SEP]
}
identifier[GetterSlot] identifier[gslot] operator[=] operator[SEP] identifier[GetterSlot] operator[SEP] identifier[slot] operator[SEP] identifier[Object] identifier[getter] operator[=] identifier[getProperty] operator[SEP] identifier[desc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getter] operator[!=] identifier[NOT_FOUND] operator[SEP] {
identifier[gslot] operator[SEP] identifier[getter] operator[=] identifier[getter] operator[SEP]
}
identifier[Object] identifier[setter] operator[=] identifier[getProperty] operator[SEP] identifier[desc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[setter] operator[!=] identifier[NOT_FOUND] operator[SEP] {
identifier[gslot] operator[SEP] identifier[setter] operator[=] identifier[setter] operator[SEP]
}
identifier[gslot] operator[SEP] identifier[value] operator[=] identifier[Undefined] operator[SEP] identifier[instance] operator[SEP] identifier[gslot] operator[SEP] identifier[setAttributes] operator[SEP] identifier[attributes] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[slot] Keyword[instanceof] identifier[GetterSlot] operator[&&] identifier[isDataDescriptor] operator[SEP] identifier[desc] operator[SEP] operator[SEP] {
identifier[slot] operator[=] identifier[getSlot] operator[SEP] identifier[cx] , identifier[id] , identifier[SlotAccess] operator[SEP] identifier[CONVERT_ACCESSOR_TO_DATA] operator[SEP] operator[SEP]
}
identifier[Object] identifier[value] operator[=] identifier[getProperty] operator[SEP] identifier[desc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] identifier[NOT_FOUND] operator[SEP] {
identifier[slot] operator[SEP] identifier[value] operator[=] identifier[value] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[isNew] operator[SEP] {
identifier[slot] operator[SEP] identifier[value] operator[=] identifier[Undefined] operator[SEP] identifier[instance] operator[SEP]
}
identifier[slot] operator[SEP] identifier[setAttributes] operator[SEP] identifier[attributes] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings({"rawtypes"})
protected void checkDataFile(TridentCollector collector) throws IOException,
InterruptedException
{
// 初回は更新がない場合でも読みこみを行い、その上でファイル更新監視を開始する。
if (this.isInitialReaded == false)
{
List<String> fileContents = FileUtils.readLines(this.targetFile);
emitTuples(fileContents, collector);
this.isInitialReaded = true;
// ファイル更新監視を開始
Path dirPath = new File(this.dataFileDir).toPath();
FileSystem fileSystem = dirPath.getFileSystem();
this.watcherService = fileSystem.newWatchService();
this.watchKey = dirPath.register(this.watcherService, new Kind[]{
StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY});
return;
}
// ファイル更新が行なわれているかを確認する。
WatchKey detectedKey = this.watcherService.poll(1, TimeUnit.SECONDS);
// ファイルの更新イベントが取得できなかった場合、または監視対象のイベントではない場合、終了する。
if (detectedKey == null || detectedKey.equals(this.watchKey) == false)
{
return;
}
try
{
// ファイル更新イベントが存在した場合、中身のファイルを読み込んで送信し、イベントの受付を再開する。
for (WatchEvent event : detectedKey.pollEvents())
{
Path filePath = (Path) event.context();
// 同一ディレクトリ配下の別名ファイルの場合は読み込みを行わない。
if (filePath == null
|| this.targetFile.toPath().getFileName().equals(filePath.getFileName()) == false)
{
continue;
}
List<String> fileContents = FileUtils.readLines(this.targetFile);
emitTuples(fileContents, collector);
}
}
finally
{
detectedKey.reset();
}
} | class class_name[name] begin[{]
method[checkDataFile, return_type[void], modifier[protected], parameter[collector]] begin[{]
if[binary_operation[THIS[member[None.isInitialReaded]], ==, literal[false]]] begin[{]
local_variable[type[List], fileContents]
call[.emitTuples, parameter[member[.fileContents], member[.collector]]]
assign[THIS[member[None.isInitialReaded]], literal[true]]
local_variable[type[Path], dirPath]
local_variable[type[FileSystem], fileSystem]
assign[THIS[member[None.watcherService]], call[fileSystem.newWatchService, parameter[]]]
assign[THIS[member[None.watchKey]], call[dirPath.register, parameter[THIS[member[None.watcherService]], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=ENTRY_CREATE, postfix_operators=[], prefix_operators=[], qualifier=StandardWatchEventKinds, selectors=[]), MemberReference(member=ENTRY_MODIFY, postfix_operators=[], prefix_operators=[], qualifier=StandardWatchEventKinds, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Kind, sub_type=None))]]]
return[None]
else begin[{]
None
end[}]
local_variable[type[WatchKey], detectedKey]
if[binary_operation[binary_operation[member[.detectedKey], ==, literal[null]], ||, binary_operation[call[detectedKey.equals, parameter[THIS[member[None.watchKey]]]], ==, literal[false]]]] begin[{]
return[None]
else begin[{]
None
end[}]
TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=context, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), name=filePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=filePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=targetFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=toPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getFileName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFileName, postfix_operators=[], prefix_operators=[], qualifier=filePath, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=targetFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=readLines, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[], type_arguments=None), name=fileContents)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fileContents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=collector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=emitTuples, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=pollEvents, postfix_operators=[], prefix_operators=[], qualifier=detectedKey, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=event)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WatchEvent, sub_type=None))), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=detectedKey, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String]
} operator[SEP] Keyword[protected] Keyword[void] identifier[checkDataFile] operator[SEP] identifier[TridentCollector] identifier[collector] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isInitialReaded] operator[==] literal[boolean] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[fileContents] operator[=] identifier[FileUtils] operator[SEP] identifier[readLines] operator[SEP] Keyword[this] operator[SEP] identifier[targetFile] operator[SEP] operator[SEP] identifier[emitTuples] operator[SEP] identifier[fileContents] , identifier[collector] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[isInitialReaded] operator[=] literal[boolean] operator[SEP] identifier[Path] identifier[dirPath] operator[=] Keyword[new] identifier[File] operator[SEP] Keyword[this] operator[SEP] identifier[dataFileDir] operator[SEP] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] identifier[FileSystem] identifier[fileSystem] operator[=] identifier[dirPath] operator[SEP] identifier[getFileSystem] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[watcherService] operator[=] identifier[fileSystem] operator[SEP] identifier[newWatchService] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[watchKey] operator[=] identifier[dirPath] operator[SEP] identifier[register] operator[SEP] Keyword[this] operator[SEP] identifier[watcherService] , Keyword[new] identifier[Kind] operator[SEP] operator[SEP] {
identifier[StandardWatchEventKinds] operator[SEP] identifier[ENTRY_CREATE] , identifier[StandardWatchEventKinds] operator[SEP] identifier[ENTRY_MODIFY]
} operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[WatchKey] identifier[detectedKey] operator[=] Keyword[this] operator[SEP] identifier[watcherService] operator[SEP] identifier[poll] operator[SEP] Other[1] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[detectedKey] operator[==] Other[null] operator[||] identifier[detectedKey] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[watchKey] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[try] {
Keyword[for] operator[SEP] identifier[WatchEvent] identifier[event] operator[:] identifier[detectedKey] operator[SEP] identifier[pollEvents] operator[SEP] operator[SEP] operator[SEP] {
identifier[Path] identifier[filePath] operator[=] operator[SEP] identifier[Path] operator[SEP] identifier[event] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filePath] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[targetFile] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[filePath] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[List] operator[<] identifier[String] operator[>] identifier[fileContents] operator[=] identifier[FileUtils] operator[SEP] identifier[readLines] operator[SEP] Keyword[this] operator[SEP] identifier[targetFile] operator[SEP] operator[SEP] identifier[emitTuples] operator[SEP] identifier[fileContents] , identifier[collector] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
identifier[detectedKey] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private void duplicateDeletion(final String spaceId,
final String contentId)
throws TaskExecutionFailedException {
if (existsInSourceManifest(spaceId, contentId)) {
throw new TaskExecutionFailedException(
MessageFormat.format("item exists in source manifest and thus appears to be " +
"missing content. account={0}, storeId={1}, spaceId={2}, contentId={3}",
this.dupTask.getAccount(),
this.dupTask.getSourceStoreId(),
spaceId,
contentId));
}
log.info("Duplicating deletion of " + contentId + " in dest space " +
spaceId + " in account " + dupTask.getAccount());
try {
new Retrier().execute(new Retriable() {
@Override
public String retry() throws Exception {
// Delete content
destStore.deleteContent(spaceId, contentId);
return "success";
}
});
} catch (Exception e) {
String msg = "Error attempting to delete content : " + e.getMessage();
throw new DuplicationTaskExecutionFailedException(buildFailureMessage(msg), e);
}
log.info("Successfully deleted content item (content_id=" + contentId +
") in dest space (space_id=" + spaceId + ") where account_id=" +
dupTask.getAccount());
} | class class_name[name] begin[{]
method[duplicateDeletion, return_type[void], modifier[private], parameter[spaceId, contentId]] begin[{]
if[call[.existsInSourceManifest, parameter[member[.spaceId], member[.contentId]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="item exists in source manifest and thus appears to be "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="missing content. account={0}, storeId={1}, spaceId={2}, contentId={3}"), operator=+), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dupTask, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getAccount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dupTask, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getSourceStoreId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=MessageFormat, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TaskExecutionFailedException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[log.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Duplicating deletion of "], +, member[.contentId]], +, literal[" in dest space "]], +, member[.spaceId]], +, literal[" in account "]], +, call[dupTask.getAccount, parameter[]]]]]
TryStatement(block=[StatementExpression(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteContent, postfix_operators=[], prefix_operators=[], qualifier=destStore, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="success"), label=None)], documentation=None, modifiers={'public'}, name=retry, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=['Exception'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Retriable, sub_type=None))], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Retrier, sub_type=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error attempting to delete content : "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildFailureMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DuplicationTaskExecutionFailedException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
call[log.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Successfully deleted content item (content_id="], +, member[.contentId]], +, literal[") in dest space (space_id="]], +, member[.spaceId]], +, literal[") where account_id="]], +, call[dupTask.getAccount, parameter[]]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[duplicateDeletion] operator[SEP] Keyword[final] identifier[String] identifier[spaceId] , Keyword[final] identifier[String] identifier[contentId] operator[SEP] Keyword[throws] identifier[TaskExecutionFailedException] {
Keyword[if] operator[SEP] identifier[existsInSourceManifest] operator[SEP] identifier[spaceId] , identifier[contentId] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[TaskExecutionFailedException] operator[SEP] identifier[MessageFormat] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] literal[String] , Keyword[this] operator[SEP] identifier[dupTask] operator[SEP] identifier[getAccount] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[dupTask] operator[SEP] identifier[getSourceStoreId] operator[SEP] operator[SEP] , identifier[spaceId] , identifier[contentId] operator[SEP] operator[SEP] operator[SEP]
}
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[contentId] operator[+] literal[String] operator[+] identifier[spaceId] operator[+] literal[String] operator[+] identifier[dupTask] operator[SEP] identifier[getAccount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[new] identifier[Retrier] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[Retriable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[retry] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[destStore] operator[SEP] identifier[deleteContent] operator[SEP] identifier[spaceId] , identifier[contentId] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP]
}
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DuplicationTaskExecutionFailedException] operator[SEP] identifier[buildFailureMessage] operator[SEP] identifier[msg] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[contentId] operator[+] literal[String] operator[+] identifier[spaceId] operator[+] literal[String] operator[+] identifier[dupTask] operator[SEP] identifier[getAccount] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.